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,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, `</span><span class="ellipsis">`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `</span><span class="invisible">`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `</span>`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `<span>`, "", -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, `</span><span class="ellipsis">`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `</span><span class="invisible">`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `</span>`, "", -1)
|
||||
mastodonContent = strings.Replace(mastodonContent, `<span>`, "", -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue