From 50cf546d6cea42d80c5500bc0582eea1492f7189 Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Tue, 18 Dec 2018 11:08:21 +0100 Subject: [PATCH] Removed filtering @-replies (the RSS feed doesn't contain them) and parse feeds description again instead of content (RSS vs. Atom). --- getarticles.go | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/getarticles.go b/getarticles.go index 2d6b783..5123c2a 100644 --- a/getarticles.go +++ b/getarticles.go @@ -194,22 +194,20 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) { // Remove redirects and tracking parameters from URL. cleanURL, _ := removeTracking(article.Link) // Don't process mastodon messages that are a reply - if strings.Contains(article.Content, "http://activitystrea.ms/schema/1.0/comment") == false { - // Strip HTML as we want to get plain text. - mastodonContent := strings.Replace(article.Content, ``, "", -1) - mastodonContent = strings.Replace(mastodonContent, ``, "", -1) - mastodonContent = strings.Replace(mastodonContent, ``, "", -1) - mastodonContent, err = html2text.FromString(mastodonContent, html2text.Options{OmitLinks: true}) - if err != nil { - return "", err - } + // Strip HTML as we want to get plain text. + mastodonContent := strings.Replace(article.Description, ``, "", -1) + mastodonContent = strings.Replace(mastodonContent, ``, "", -1) + mastodonContent = strings.Replace(mastodonContent, ``, "", -1) + mastodonContent, err = html2text.FromString(mastodonContent, html2text.Options{OmitLinks: true}) + if err != nil { + return "", err + } - output = output + "Kuketz-Blog: " + mastodonContent + "\n\n" + cleanURL + output = output + "Kuketz-Blog: " + mastodonContent + "\n\n" + cleanURL - if i > 0 { - output = output + "\n\n---\n\n" - } + if i > 0 { + output = output + "\n\n---\n\n" } }