2022-04-26 09:55:59 -04:00
|
|
|
package app
|
|
|
|
|
2022-04-27 00:19:05 -04:00
|
|
|
func Run(configPath string) {
|
|
|
|
/*
|
|
|
|
cfg, err := ParseConfig(configPath)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2022-04-26 09:55:59 -04:00
|
|
|
|
2022-04-27 00:19:05 -04:00
|
|
|
for _, feed := range cfg.Feeds {
|
|
|
|
log.Println("Processing feed", feed.Name)
|
|
|
|
data, err := Download(feed.Url, feed.Proxy)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
2022-04-26 09:55:59 -04:00
|
|
|
|
2022-04-27 00:19:05 -04:00
|
|
|
for _, feed := range c.Feeds {
|
|
|
|
log.Println("Processing feed", feed.Name)
|
|
|
|
|
|
|
|
links, err := parseFeed(data)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2022-04-26 09:55:59 -04:00
|
|
|
|
2022-04-27 00:19:05 -04:00
|
|
|
for _, link := range links {
|
|
|
|
if alreadySent(link) {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
err := sendTelegram(link, feed.Channel, feed.Rhash)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Println(configPath)
|
|
|
|
*/
|
2022-04-26 09:55:59 -04:00
|
|
|
}
|