mirror of
https://github.com/bellingcat/reddit-post-scraping-tool.git
synced 2026-06-12 21:48:29 +03:00
Merge pull request #20 from bellingcat/galen-endpoint-fix
Add subdomain to Reddit endpoint to avoid redirect
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user