Skip to content

Commit

Permalink
add dc:date item support
Browse files Browse the repository at this point in the history
  • Loading branch information
runtakun committed May 5, 2014
1 parent 2245994 commit ed75d06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion rss 1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func parseRSS1(data []byte, read *db) (*Feed, error) {
if err != nil {
return nil, err
}
} else if item.PubDate != "" {
next.Date, err = parseTime(item.PubDate)
if err != nil {
return nil, err
}
}
next.ID = item.ID
next.Read = false
Expand Down Expand Up @@ -126,7 +131,8 @@ type rss1_0Item struct {
Title string `xml:"title"`
Content string `xml:"description"`
Link string `xml:"link"`
Date string `xml:"pubDate"`
PubDate string `xml:"pubDate"`
Date string `xml:"date"`
ID string `xml:"guid"`
}

Expand Down
8 changes: 7 additions & 1 deletion rss 2.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func parseRSS2(data []byte, read *db) (*Feed, error) {
if err != nil {
return nil, err
}
} else if item.PubDate != "" {
next.Date, err = parseTime(item.PubDate)
if err != nil {
return nil, err
}
}
next.ID = item.ID
next.Read = false
Expand Down Expand Up @@ -126,7 +131,8 @@ type rss2_0Item struct {
Title string `xml:"title"`
Content string `xml:"description"`
Link string `xml:"link"`
Date string `xml:"pubDate"`
PubDate string `xml:"pubDate"`
Date string `xml:"date"`
ID string `xml:"guid"`
}

Expand Down

0 comments on commit ed75d06

Please sign in to comment.