Documentation ¶
Index ¶
- type HtmlFetcher
- type Outcome
- type PredictionListPageInfo
- type PredictionResponse
- type PredictionSummary
- type Source
- func (s *Source) AllPredictionResponses(ctx context.Context, predictions []*PredictionSummary) (summaries []*PredictionSummary, responses []*PredictionResponse, err error)
- func (s *Source) AllPredictions(ctx context.Context) (predictions []*PredictionSummary, err error)
- func (s *Source) AllPredictionsSince(ctx context.Context, t time.Time) (predictions []*PredictionSummary, err error)
- func (s *Source) Latest(ctx context.Context) (*PredictionSummary, error)
- func (s *Source) PredictionPageCount(ctx context.Context) (int64, error)
- func (s *Source) RetrievePredictionListPage(ctx context.Context, index int64) (predictions []*PredictionSummary, pageInfo *PredictionListPageInfo, err error)
- func (s *Source) RetrievePredictionResponses(ctx context.Context, prediction int64) (summary *PredictionSummary, responses []*PredictionResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HtmlFetcher ¶
type PredictionListPageInfo ¶
func ExtractPredictionListPageInfo ¶
func ExtractPredictionListPageInfo(rootNode *html.Node, index int64) (pageInfo *PredictionListPageInfo)
type PredictionResponse ¶
type PredictionResponse struct { Prediction int64 Time time.Time User string Confidence float64 Comment string }
func ExtractPredictionResponse ¶
func ExtractPredictionResponse(responseNode *html.Node, prediction int64) (response *PredictionResponse)
type PredictionSummary ¶
type PredictionSummary struct { Id int64 Title string Creator string Created time.Time Deadline time.Time MeanConfidence float64 WagerCount int64 Outcome Outcome }
func ExtractPredictionSummary ¶
func ExtractPredictionSummary(predictionNode *html.Node) (prediction *PredictionSummary)
func ExtractPredictionSummaryResponsePage ¶
func ExtractPredictionSummaryResponsePage(id int64, responsePageNode *html.Node) (prediction *PredictionSummary)
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func NewSource ¶
func NewSource(htmlFetcher HtmlFetcher, baseUrl string) *Source
func (*Source) AllPredictionResponses ¶
func (s *Source) AllPredictionResponses(ctx context.Context, predictions []*PredictionSummary) (summaries []*PredictionSummary, responses []*PredictionResponse, err error)
func (*Source) AllPredictions ¶
func (s *Source) AllPredictions(ctx context.Context) (predictions []*PredictionSummary, err error)
func (*Source) AllPredictionsSince ¶
func (*Source) PredictionPageCount ¶
func (*Source) RetrievePredictionListPage ¶
func (s *Source) RetrievePredictionListPage(ctx context.Context, index int64) (predictions []*PredictionSummary, pageInfo *PredictionListPageInfo, err error)
func (*Source) RetrievePredictionResponses ¶
func (s *Source) RetrievePredictionResponses(ctx context.Context, prediction int64) (summary *PredictionSummary, responses []*PredictionResponse, err error)
Click to show internal directories.
Click to hide internal directories.