From ad547b4eaf86aecbb9399a3e849d3c352dde7475 Mon Sep 17 00:00:00 2001 From: Galen Reich <54807169+GalenReich@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:32:05 +0000 Subject: [PATCH 1/2] Add explicit www. to reddit endpoint --- rpst/rpst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpst/rpst.py b/rpst/rpst.py index d30f8b9..6ca7d1b 100644 --- a/rpst/rpst.py +++ b/rpst/rpst.py @@ -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() From 10fa0688a5c15052c3055b8351164f23d4bc7876 Mon Sep 17 00:00:00 2001 From: Galen Reich <54807169+GalenReich@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:32:45 +0000 Subject: [PATCH 2/2] Add explicit www. to api endpoint --- RPST GUI/RPST/ApiHandler.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RPST GUI/RPST/ApiHandler.vb b/RPST GUI/RPST/ApiHandler.vb index 8410da9..d2a56d4 100644 --- a/RPST GUI/RPST/ApiHandler.vb +++ b/RPST GUI/RPST/ApiHandler.vb @@ -16,7 +16,7 @@ Public Class ApiHandler ''' ''' Json object containing scraped data. 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