mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-11-22 22:18:39 +01:00
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:
parent
330d94cfd7
commit
50cf546d6c
1 changed files with 12 additions and 14 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue