Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Add subdomain to Reddit endpoint to avoid redirect #20

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RPST GUI/RPST/ApiHandler.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Public Class ApiHandler
''' </summary>
''' <returns>Json object containing scraped data.</returns>
Public Async Function ScrapeRedditAsync(subreddit As String, listing As String, limit As Integer, timeframe As String) As Task(Of JObject)
Dim ApiEndpoint As String = $"https://reddit.com/r/{subreddit}/{listing}.json?limit={limit}&t={timeframe}"
Dim ApiEndpoint As String = $"https://www.reddit.com/r/{subreddit}/{listing}.json?limit={limit}&t={timeframe}"
Return Await GetJObjectFromEndpointAsync(endpoint:=ApiEndpoint)
End Function

Expand Down
2 changes: 1 addition & 1 deletion rpst/rpst.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_posts(args: argparse):
# Send a GET request to the specified subreddit and listing,
# limiting the response by the specified limit and timeframe.
response = session.get(
f"https://reddit.com/r/{subreddit}/{listing}"
f"https://www.reddit.com/r/{subreddit}/{listing}"
f".json?limit={limit}&t={timeframe}"
).json()

Expand Down