From 3aa1f273b62254f98257d211a597fc91b0f2fd1e Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Sun, 2 Jun 2024 17:51:49 +0100 Subject: [PATCH] Add tags to dedicated field rather than to title --- internal/feed/lobsters.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/feed/lobsters.go b/internal/feed/lobsters.go index 6e56cd8..dc53e65 100644 --- a/internal/feed/lobsters.go +++ b/internal/feed/lobsters.go @@ -2,7 +2,6 @@ package feed import ( "net/http" - "strings" "time" ) @@ -34,22 +33,17 @@ func getLobstersPostsFromFeed(feedUrl string) (ForumPosts, error) { posts := make(ForumPosts, 0, len(feed)) for i := range feed { - tags := strings.Join(feed[i].Tags, ", ") - - if tags != "" { - tags = " [" + tags + "]" - } - createdAt, _ := time.Parse(time.RFC3339, feed[i].CreatedAt) posts = append(posts, ForumPost{ - Title: feed[i].Title + tags, + Title: feed[i].Title, DiscussionUrl: feed[i].CommentsURL, TargetUrl: feed[i].URL, TargetUrlDomain: extractDomainFromUrl(feed[i].URL), CommentCount: feed[i].CommentCount, Score: feed[i].Score, TimePosted: createdAt, + Tags: feed[i].Tags, }) }