mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-11-22 14:08:39 +01:00
Revert "(Hopefully) made help output look more nice."
This reverts commit 5c24584476
.
This commit is contained in:
parent
5c24584476
commit
b73f39ef48
2 changed files with 3 additions and 13 deletions
|
@ -251,8 +251,8 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str
|
||||||
_, err = client.Send(xmpp.Chat{Remote: muc,
|
_, err = client.Send(xmpp.Chat{Remote: muc,
|
||||||
Type: "groupchat", Text: strings.Split(v.Remote, "/")[1] +
|
Type: "groupchat", Text: strings.Split(v.Remote, "/")[1] +
|
||||||
": The following commands are available:\n" +
|
": The following commands are available:\n" +
|
||||||
"feeds " + "List feeds I'm following.\n" +
|
"feeds\t" + "List feeds I'm following.\n" +
|
||||||
"source " + "Show source code URL."})
|
"source\t" + "Show source code URL."})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,23 +209,13 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// To make the message look not so bloated we remove multiple newlines.
|
|
||||||
// Split the article description/content into fragments between newlines.
|
|
||||||
fragments := strings.Split(description, "\n")
|
|
||||||
// Empty article description/content
|
|
||||||
description = ""
|
|
||||||
// Fill article description/content with the fragments separated by one newline.
|
|
||||||
for _, line := range fragments {
|
|
||||||
description = description + line + "n"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only append article link if it is not yet contained in description (e.g. read more: URL).
|
// Only append article link if it is not yet contained in description (e.g. read more: URL).
|
||||||
if strings.Contains(description, article.Link) == true {
|
if strings.Contains(description, article.Link) == true {
|
||||||
// Replace article link with URL cleaned from redirects and trackers.
|
// Replace article link with URL cleaned from redirects and trackers.
|
||||||
description = strings.Replace(description, article.Link, cleanURL, -1)
|
description = strings.Replace(description, article.Link, cleanURL, -1)
|
||||||
output = output + feed.Title + ": *" + article.Title + "*\n\n" + description
|
output = output + feed.Title + ": *" + article.Title + "*\n\n" + description
|
||||||
} else {
|
} else {
|
||||||
output = output + feed.Title + ": *" + article.Title + "*\n\n" + description + cleanURL
|
output = output + feed.Title + ": *" + article.Title + "*\n\n" + description + "\n" + cleanURL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue