Removed filtering @-replies (the RSS feed doesn't contain them) and parse feeds description again instead of content (RSS vs. Atom).

This commit is contained in:
Martin Dosch 2018-12-18 11:08:21 +01:00
parent 330d94cfd7
commit 50cf546d6c

View file

@ -194,9 +194,8 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
// Remove redirects and tracking parameters from URL. // Remove redirects and tracking parameters from URL.
cleanURL, _ := removeTracking(article.Link) cleanURL, _ := removeTracking(article.Link)
// Don't process mastodon messages that are a reply // 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. // Strip HTML as we want to get plain text.
mastodonContent := strings.Replace(article.Content, `</span><span class="ellipsis">`, "", -1) mastodonContent := strings.Replace(article.Description, `</span><span class="ellipsis">`, "", -1)
mastodonContent = strings.Replace(mastodonContent, `</span><span class="invisible">`, "", -1) mastodonContent = strings.Replace(mastodonContent, `</span><span class="invisible">`, "", -1)
mastodonContent = strings.Replace(mastodonContent, `</span>`, "", -1) mastodonContent = strings.Replace(mastodonContent, `</span>`, "", -1)
mastodonContent = strings.Replace(mastodonContent, `<span>`, "", -1) mastodonContent = strings.Replace(mastodonContent, `<span>`, "", -1)
@ -211,7 +210,6 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
output = output + "\n\n---\n\n" output = output + "\n\n---\n\n"
} }
} }
}
return output, err return output, err
} }