mirror of
https://github.com/pikami/rss-dl.git
synced 2024-11-27 16:08:13 +00:00
Download feed image
This commit is contained in:
parent
be2baffe69
commit
12e6b93520
4
main.go
4
main.go
@ -26,6 +26,9 @@ func main() {
|
|||||||
LogInfo("Writing feed details as JSON to " + feedInfoPath)
|
LogInfo("Writing feed details as JSON to " + feedInfoPath)
|
||||||
WriteToFile(feedInfoPath, GrabFeedDetailsJSON(feed))
|
WriteToFile(feedInfoPath, GrabFeedDetailsJSON(feed))
|
||||||
|
|
||||||
|
feedImagePath := outputDir + "/image" + filepath.Ext(feed.Image.URL)
|
||||||
|
DownloadFile(feedImagePath, feed.Image.URL)
|
||||||
|
|
||||||
for _, item := range feed.Items {
|
for _, item := range feed.Items {
|
||||||
itemOutputFilename := ToCleanString(
|
itemOutputFilename := ToCleanString(
|
||||||
item.PublishedParsed.Format("20060102") + "_" + item.Title)
|
item.PublishedParsed.Format("20060102") + "_" + item.Title)
|
||||||
@ -69,6 +72,7 @@ func GrabFeedDetailsJSON(feed *gofeed.Feed) string {
|
|||||||
Categories: feed.Categories,
|
Categories: feed.Categories,
|
||||||
Language: feed.Language,
|
Language: feed.Language,
|
||||||
Link: feed.Link,
|
Link: feed.Link,
|
||||||
|
FeedLink: feed.FeedLink,
|
||||||
Updated: feed.Updated,
|
Updated: feed.Updated,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ type FeedDetails struct {
|
|||||||
Title string
|
Title string
|
||||||
Description string
|
Description string
|
||||||
Link string
|
Link string
|
||||||
|
FeedLink string
|
||||||
Updated string
|
Updated string
|
||||||
Language string
|
Language string
|
||||||
Categories []string
|
Categories []string
|
||||||
|
Loading…
Reference in New Issue
Block a user