Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID int `json:"id,omitempty"` CanonicalURL string `json:"canonical_url,omitempty"` // all known URLs for article (including canonical) // TODO: first url should be considered "preferred" if no canonical? URLs []string `json:"urls,omitempty"` Headline string `json:"headline,omitempty"` Authors []Author `json:"authors,omitempty"` Content string `json:"content,omitempty"` // Published contains date of publication. // An ISO8601 string is used instead of time.Time, so that // less-precise representations can be held (eg YYYY-MM) // If no timezone is given, assume UTC. Published string `json:"published,omitempty"` Updated string `json:"updated,omitempty"` Publication Publication `json:"publication,omitempty"` Keywords []Keyword `json:"keywords,omitempty"` Section string `json:"section,omitempty"` // space for extra, free-form data // Extra interface{} `json:"extra,omitempty"` // Ha! not free-form any more! (bugfix for annoying int/float json issue) Extra *TweetExtra `json:"extra,omitempty"` }
func ConvertArticle ¶
copy an arts.Article into our struct
type Filter ¶
type Filter struct { // date ranges are [from,to) PubFrom time.Time PubTo time.Time AddedFrom time.Time AddedTo time.Time // if empty, accept all publications (else only ones in list) PubCodes []string // exclude any publications in XPubCodes XPubCodes []string // Only return articles with ID > SinceID SinceID int // max number of articles wanted Count int }
Filter is a set of params for querying the store
type Publication ¶
type Store ¶
type Store interface { Close() Stash(arts ...*Article) ([]int, error) WhichAreNew(artURLs []string) ([]string, error) FindURLs(urls []string) ([]int, error) FetchCount(filt *Filter) (int, error) Fetch(filt *Filter) ArtIter FetchPublications() ([]Publication, error) FetchSummary(filt *Filter, group string) ([]DatePubCount, error) FetchArt(artID int) (*Article, error) }
type TweetExtra ¶
Click to show internal directories.
Click to hide internal directories.