Documentation ¶
Index ¶
- func AddFeeds(buf io.StringWriter, config *Config)
- func AddSource(title, link string)
- func FormatURL(link string) (string, bool)
- func GetHostFromURL(host string) string
- func GetHostPrefix(link string) string
- func InitFeedDB(dataDir string)
- func Operate(ops []string)
- func ParseGoFeed(source *Source) (*gofeed.Feed, error)
- type Article
- type Config
- type Detail
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFeeds ¶
func AddFeeds(buf io.StringWriter, config *Config)
func GetHostFromURL ¶
GetHostFromURL get host from url, host is www.blog.com if url is http://www.blog.com/page.html.
func GetHostPrefix ¶
GetHostPrefix get host prefix from url, prefix is http://www.blog.com if url is http://www.blog.com/page.html.
func InitFeedDB ¶
func InitFeedDB(dataDir string)
Types ¶
type Article ¶
type Article struct { ID int64 `json:"id" gorm:"primarykey;AUTO_INCREMENT"` URL string `json:"url" gorm:"index"` Title string `json:"title"` Timestamp int64 `json:"timestamp"` Weight int64 `json:"weight"` Informed bool `json:"informed" gorm:"index"` Score int64 `json:"score" gorm:"index"` }
func RegexParse ¶
func UpdateAndFilterFeeds ¶
type Source ¶
type Source struct { ID int64 `json:"id" gorm:"primarykey;AUTO_INCREMENT"` Title string `json:"title"` URL string `json:"url"` CURL string `json:"curl"` Weight int64 `json:"weight"` MaxFetchNum int `json:"max_fetch_num"` Regex string `json:"regex"` TitleExp string `json:"title_exp"` URLExp string `json:"url_exp"` Redirect bool `json:"redirect"` // if redirect the parsed url Sort bool `json:"sort"` // whether sort the result }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.