Skip to content

Commit ed75d06

Browse files
committed
add dc:date item support
1 parent 2245994 commit ed75d06

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

rss 1.0.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func parseRSS1(data []byte, read *db) (*Feed, error) {
8787
if err != nil {
8888
return nil, err
8989
}
90+
} else if item.PubDate != "" {
91+
next.Date, err = parseTime(item.PubDate)
92+
if err != nil {
93+
return nil, err
94+
}
9095
}
9196
next.ID = item.ID
9297
next.Read = false
@@ -126,7 +131,8 @@ type rss1_0Item struct {
126131
Title string `xml:"title"`
127132
Content string `xml:"description"`
128133
Link string `xml:"link"`
129-
Date string `xml:"pubDate"`
134+
PubDate string `xml:"pubDate"`
135+
Date string `xml:"date"`
130136
ID string `xml:"guid"`
131137
}
132138

rss 2.0.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func parseRSS2(data []byte, read *db) (*Feed, error) {
8787
if err != nil {
8888
return nil, err
8989
}
90+
} else if item.PubDate != "" {
91+
next.Date, err = parseTime(item.PubDate)
92+
if err != nil {
93+
return nil, err
94+
}
9095
}
9196
next.ID = item.ID
9297
next.Read = false
@@ -126,7 +131,8 @@ type rss2_0Item struct {
126131
Title string `xml:"title"`
127132
Content string `xml:"description"`
128133
Link string `xml:"link"`
129-
Date string `xml:"pubDate"`
134+
PubDate string `xml:"pubDate"`
135+
Date string `xml:"date"`
130136
ID string `xml:"guid"`
131137
}
132138

0 commit comments

Comments
 (0)