Questions tagged [reddit]

Use for questions involving the API for Reddit, a social news ranking website.

Reddit, pronounced /ˈrɛdɪt/ or "red-it", is a social news ranking website.

Users have the option to submit links to content on the Internet or submit "self" posts that contain original, user-submitted text.

Other users may then vote the posted links "up" or "down" with the most successful links gaining prominence by reaching the front page.

In addition, users can comment on the posted links and reply to other commentators consequently forming an online community. Reddit users (also referred to as redditors) may create their own topical sections, known as subreddits, for which to submit their links and to comment, while appealing to a specific niche.

Reddit is open source, and the primary codebase is hosted on Github. An extensive API is also provided.

1261 questions
5
votes
2 answers

Getting a 401 error code when using OAuth with Reddit

I keep getting {"error" : 401} when trying to OAuth into Reddit on ruby using the oauth2 gem. The wiki page says that this is because of incorrect or non-existent credentials but I'm positive I have the correct ones: require "oauth2" require…
avinashbot
  • 1,177
  • 1
  • 11
  • 25
5
votes
1 answer

Reddit API only returning one post

I am trying to get all of the links in a subreddit using the API, but it is only returning one url. Here is the code I have: var request = require('request'); webpage =…
Edward Yu
  • 776
  • 2
  • 6
  • 15
5
votes
1 answer

HTTP Error 504: Gateway Time-out when trying to read a reddit comments post

I am encountering an error when trying to get a comments' http from reddit. This has happened to various URLs (not all of them with special characters) and this is one of them. In one hour time frame, there may be 1000 or more requests to the…
Giannis H.
  • 145
  • 1
  • 1
  • 9
5
votes
2 answers

Help getting URL linked to by Reddit post With PRAW

Using Praw I am trying to get the post linked to in the title of a Reddit submission. For example the submission links to this image. I have tried figuring out a way to extract this information from the Submission object in PRAW however even when…
WhiteWhim
  • 73
  • 1
  • 4
4
votes
1 answer

Get score for an url on Reddit, using jQuery getJSON

I am trying to get the score for a certain URL from reddit. To add a "share with reddit (count)" link: function redditCounter(url) { // Get number of counts from reddit JSON api // $.getJSON('http://www.reddit.com/api/info.json?url='+url+'', …
berkes
  • 26,996
  • 27
  • 115
  • 206
4
votes
3 answers

Most efficient data structure to represent threaded comments in Java?

I want to represent threaded comments in Java. This would look similar to the way comments are threaded on reddit.com hello hello hello hello hello hello hello As in the example above, responses are nested in the HTML…
Hula
  • 219
  • 1
  • 4
  • 11
4
votes
0 answers

expo auth response is always null

I've searched on here already but it seems all the answers are very outdated or they are questions that haven't been answered. I've got an expo app SDK 43 and I'm using their auth library to authorize a reddit login. I've followed the example here…
abg
  • 319
  • 4
  • 10
4
votes
1 answer

How to resolve the error related to frame used in zstandard which requires too much memory for decoding

To download the data related to questions and answers, I am following the script on facebook/ELI5. There it says to run the command: python download_reddit_qalist.py -Q. On running this command, I get an error on line number 70 in python file…
akshit bhatia
  • 573
  • 6
  • 22
4
votes
1 answer

Is there a way to bulk subscribe to all subreddits in a particular list programmatically (there is no built-in way to do this)

Currently the list is return-separated and " (break)" separated as well, but of course it could be in any other format such as csv. or whatever. Hoping someone here could help me. I scoured google to try and find a solution but couldn't for the life…
4
votes
1 answer

Is there a way to aggregate the number of times a keyword is mentioned in a Subreddit over time?

import requests import pandas as pd def get_pushshift_data(data_type, **kwargs): """ Gets data from the pushshift api. """ base_url = f"https://api.pushshift.io/reddit/search/{data_type}/" payload = kwargs request =…
Christian
  • 139
  • 9
4
votes
1 answer

How does Reddit sort query their database for "what's hot"?

I want to implement something similar on my site. Submissions have up_votes and down_votes. I'd imagine reddit does some sort of database query that takes into account the up_votes vs. total_votes and maybe factors in # of views and # of comments…
goddamnyouryan
  • 6,854
  • 15
  • 56
  • 105
4
votes
3 answers

Regex to identify Reddit usernames

I am making a bot with a option to not post if the username is not a certain user. Reddit usernames can contain letters in both cases, and have numbers. Which regex can be used to identify such a username? The format is /u/USERNAME where username…
Pokestar Fan
  • 174
  • 1
  • 12
4
votes
4 answers

Frequently receiving 503 error when conducting Reddit search with PRAW

I'm using PRAW to view a large number of Reddit search results (both submissions and comments), and the method I'm using to collect the data is frequently generating a 503 error: prawcore.exceptions.ServerError: received 503 HTTP response As I…
Dreadnaught
  • 125
  • 2
  • 6
4
votes
1 answer

How to gain Reddit API access token?

I have been using this as a resource: https://github.com/reddit/reddit/wiki/OAuth2-Quick-Start-Example I am referencing the Curl Example to acquire a token. Here is exactly what I am running in terminal: curl -X POST -d…
4
votes
2 answers

how to do subqueries in bigquery?

Im trying to play with the reddit data on bigquery and I want to see comments and replies in one row. I see bigquery supports subqueries, but I am unable to construct the query. I have to use a subquery to self join the same table because of the…
jas
  • 580
  • 1
  • 7
  • 18