package send import ( "brainbaking.com/go-jamming/app/rss" "brainbaking.com/go-jamming/common" "regexp" "strings" ) type RSSItem struct { link string hrefs []string } /** * a typical RSS item looks like this: -- if found in body, assume it's a lastmod update timestamp! { title: '@celia @kev I have read both you and Kev's post on...', link: 'https://brainbaking.com/notes/2021/03/16h17m07s14/', comments: 'https://brainbaking.com/notes/2021/03/16h17m07s14/#commento', pubDate: 'Tue, 16 Mar 2021 17:07:14 +0000', author: 'Wouter Groeneveld', guid: { '#text': 'https://brainbaking.com/notes/2021/03/16h17m07s14/', '@_isPermaLink': 'true' }, description: ' \n' + ' \n' + '\n' + '
@celia @kev I have read both you and Kev’s post on this and agree on some points indeed! But I’m not yet ready to give up webmentions. As an academic, the idea of citing/mentioning each other is very alluring 🤓. Plus, I needed an excuse to fiddle some more with JS…
As much as I loved using Wordpress before, I can’t imagine going back to writing stuff in there instead of in markdown. Gotta keep the workflow short, though. Hope it helps you focus on what matters - content!
\n' + ' By Wouter Groeneveld on .\n' + '
\n' + ' ' } **/ func (snder *Sender) Collect(xml string, lastSentLink string) ([]RSSItem, error) { feed, err := rss.ParseFeed([]byte(xml)) if err != nil { return nil, err } var items []RSSItem for _, rssitem := range feed.ItemList { if rssitem.Link == lastSentLink { break } items = append(items, RSSItem{ link: rssitem.Link, hrefs: snder.collectUniqueHrefsFromHtml(rssitem.Description), }) } return items, nil } var ( hrefRegexp = regexp.MustCompile(`(?i)