diff --git a/feed-to-muc.go b/feed-to-muc.go index 17dcf1c..ec32ef4 100644 --- a/feed-to-muc.go +++ b/feed-to-muc.go @@ -251,8 +251,8 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str _, err = client.Send(xmpp.Chat{Remote: muc, Type: "groupchat", Text: strings.Split(v.Remote, "/")[1] + ": The following commands are available:\n" + - "feeds " + "List feeds I'm following.\n" + - "source " + "Show source code URL."}) + "feeds\t" + "List feeds I'm following.\n" + + "source\t" + "Show source code URL."}) if err != nil { log.Fatal(err) } diff --git a/getarticles.go b/getarticles.go index 6ea90ac..aa906a3 100644 --- a/getarticles.go +++ b/getarticles.go @@ -209,23 +209,13 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) { 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). if strings.Contains(description, article.Link) == true { // Replace article link with URL cleaned from redirects and trackers. description = strings.Replace(description, article.Link, cleanURL, -1) output = output + feed.Title + ": *" + article.Title + "*\n\n" + description } else { - output = output + feed.Title + ": *" + article.Title + "*\n\n" + description + cleanURL + output = output + feed.Title + ": *" + article.Title + "*\n\n" + description + "\n" + cleanURL } }