Skip to content

Commit aa0b07e

Browse files
committed
Remove sid
1 parent 6bbdd4c commit aa0b07e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

phpbb2rss.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ func FetchAndGenerateRSS(forumURL string) (string, error) {
8686
}
8787

8888
link := topicURL.String() // Full URL for the topic
89+
q := topicURL.Query()
90+
q.Del("sid")
91+
topicURL.RawQuery = q.Encode()
92+
guid := topicURL.String() // Full URL for the topic
8993

9094
// If the latest post exists, use that link instead
9195
if latestPostExists {
@@ -94,6 +98,10 @@ func FetchAndGenerateRSS(forumURL string) (string, error) {
9498
return
9599
}
96100
link = latestPostURL.String() // Full URL for the latest post
101+
q := latestPostURL.Query()
102+
q.Del("sid")
103+
latestPostURL.RawQuery = q.Encode()
104+
guid = latestPostURL.String() // Full URL for the topic
97105
}
98106

99107
pubDateRaw := strings.TrimSpace(s.Find(".postdetails").Last().Text())
@@ -118,7 +126,7 @@ func FetchAndGenerateRSS(forumURL string) (string, error) {
118126
Link: link,
119127
Description: description,
120128
PubDate: parsedDate.Format(time.RFC1123),
121-
GUID: link,
129+
GUID: guid,
122130
})
123131
})
124132

0 commit comments

Comments
 (0)