Because some feeds has older feed's datetime than its posts ones.
news := 0
var when *time.Time
now := time.Now()
news := 0
var when *time.Time
now := time.Now()
for n, item := range feed.Items {
if n == int(*maxEntries) {
break
for n, item := range feed.Items {
if n == int(*maxEntries) {
break
+ if latest.Before(*when) {
+ latest = when
+ }
var what string
if len(item.Content) == 0 {
what = item.Description
var what string
if len(item.Content) == 0 {
what = item.Description
- when = nil
- if feed.PublishedParsed != nil {
- when = feed.PublishedParsed
- } else if feed.UpdatedParsed != nil {
- when = feed.UpdatedParsed
- }
- if when != nil {
- for _, d := range []string{"cur", "new"} {
- if err = os.Chtimes(path.Join(mdir, d), *when, *when); err != nil {
- log.Fatalln(err)
- }
+ for _, d := range []string{"cur", "new"} {
+ if err = os.Chtimes(path.Join(mdir, d), *latest, *latest); err != nil {
+ log.Fatalln(err)
}
}
fmt.Println(feed.Title)
}
}
fmt.Println(feed.Title)