sprinkle some First()s
parent
df2ebd5b6a
commit
a606a15903
|
@ -160,15 +160,15 @@ func parseMicroformats(r io.Reader) (*MastoFeed, error) {
|
||||||
}
|
}
|
||||||
feed.Title = doc.Find(".h-feed > .p-name").First().AttrOr("value", "")
|
feed.Title = doc.Find(".h-feed > .p-name").First().AttrOr("value", "")
|
||||||
doc.Find(".h-feed").Find(".h-entry, .h-cite").Each(func(i int, elem *goquery.Selection) {
|
doc.Find(".h-feed").Find(".h-entry, .h-cite").Each(func(i int, elem *goquery.Selection) {
|
||||||
cw := strings.TrimSpace(text(elem.Find(".p-summary")))
|
cw := strings.TrimSpace(text(elem.Find(".p-summary").First()))
|
||||||
if cw != "" {
|
if cw != "" {
|
||||||
cw = "[" + cw + "] "
|
cw = "[" + cw + "] "
|
||||||
}
|
}
|
||||||
feed.Items = append(feed.Items, &MastoItem{
|
feed.Items = append(feed.Items, &MastoItem{
|
||||||
Title: "",
|
Title: "",
|
||||||
Content: cw + text(elem.Find(".e-content")),
|
Content: cw + text(elem.Find(".e-content").First()),
|
||||||
Link: elem.Find("a.u-url.u-uid").AttrOr("href", ""),
|
Link: elem.Find("a.u-url.u-uid").AttrOr("href", ""),
|
||||||
Author: text(elem.Find(".p-author .p-name")),
|
Author: text(elem.Find(".p-author .p-name").First()),
|
||||||
PublishedString: elem.Find("data.dt-published").AttrOr("value", ""),
|
PublishedString: elem.Find("data.dt-published").AttrOr("value", ""),
|
||||||
IsBoost: elem.HasClass("h-cite"),
|
IsBoost: elem.HasClass("h-cite"),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue