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
7
votes
1 answer

In praw, I'm trying to print the comment body, but what if I encounter an empty comment?

I am trying to print all the comments from the top posts of a subreddit so that my bot can analyse them. I had it running earlier in the day, but I tried running it now and I have come across an error. Here is my code: r = praw.Reddit('Comment…
sunny
  • 530
  • 1
  • 6
  • 12
7
votes
1 answer

How to page through top-stories on Reddit?

Maybe I'm just tired, but I can't figure out how to use the Reddit-API to retrieve stories properly despite staring at the API docs [1] for an hour.. For example if I GET the URL http://www.reddit.com/r/gaming/top.json?limit=5 then I get 5 story…
scrrr
  • 5,135
  • 7
  • 42
  • 52
6
votes
1 answer

Get Reddit usernames of users who use a specific subreddit

I would like to generate a list of usernames of users who use a specific subreddit. As far as I know, it is not possible to simply get a list of users who subscribed to the subreddit. If that's not possible, it would probably be the best to go…
Hillcow
  • 890
  • 3
  • 19
  • 48
6
votes
2 answers

How to preform a Reddit post with okhttp

I am trying to use the Reddit API to save a post. I know I am formatting the request wrong, but I can't seem to find any documentation on how to do it correctly. If anyone could either lead me in the right direction, or help me format the request…
Jeremy Rowler
  • 387
  • 1
  • 5
  • 15
6
votes
5 answers

Android Retrofit2 reddit 404 Not Found

I am using retrofit to create an Android Client for the Reddit. At logcat to get the toke is work fine, but when I am trying to get the information of the login user, I am getting "404 Not Found". Here is my logcat: D/OkHttp: --> POST…
KostasC
  • 1,076
  • 6
  • 20
  • 40
6
votes
2 answers

How does pagination on Reddit's home page work?

Reddit uses a time decay algorithm. That would mean the sort order is subject to change. When a user goes to page 2, is there a mechanism to prevent them from seeing a post that was on page 1 but was bumped down to page 2 before they paged over? Is…
Jared Brown
  • 1,949
  • 4
  • 20
  • 28
6
votes
1 answer

How to scrape all subreddit posts in a given time period

I have a function to scrape all the posts in the Bitcoin subreddit between 2014-11-01 and 2015-10-31. However, I'm only able to extract about 990 posts that go back only to October 25. I don't understand what's happening. I included a Sys.sleep…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
6
votes
2 answers

Is there a way to submit a text post on reddit via a url

I know there's a way to submit a link post to reddit. https://www.reddit.com/r/test/submit?title=myTitle&url=http://www.exampledsfsd.com which pops up a page like this with the title and url filled in Is there a way to initiate the submission of a…
kane
  • 5,465
  • 6
  • 44
  • 72
6
votes
4 answers

reddit style voting with django

Hay i need to hand implemeneting a voting system into a model. I've had a huge helping hand from Mike DeSimone making this work in the first place, but i need to expand upon his work. Here is my current code View def show_game(request): game =…
dotty
  • 40,405
  • 66
  • 150
  • 195
6
votes
2 answers

PRAW: Comment Submitter's Username

I'm developing a reddit bot that needs to know which user submitted a comment. According to the PRAW API wrapper docs, there's no specific way to get the username of a Comment object's author. Ideally I could directly get the username back. If…
Humus
  • 95
  • 1
  • 7
6
votes
2 answers

PRAW: How to get a reddit comment object with just the comment ID?

I'm working on a bot where I only have the comment IDs, e.g., t1_asdasd. I don't have access to the parent thread or anything. Can I pull the corresponding comment object with just the comment ID?
Randy Olson
  • 3,131
  • 2
  • 26
  • 39
6
votes
3 answers

How to decode Reddit's RSS using Golang?

I've been playing about with Go's XML package and cannot see what is wrong with the following code. package main import ( "encoding/xml" "fmt" "net/http" ) type Channel struct { Items Item } type Item struct { Title …
James Parker
  • 285
  • 3
  • 6
  • 17
6
votes
3 answers

Reddit API returning useless JSON

I'm trying to scrape new stories from Reddit using their API and Python's urllib2, but I keep getting JSON documents like this one: { u'kind': u'Listing', u'data': { u'modhash': u'', u'children': [], u'after': None, u'before': None }} Here is my…
user1253795
5
votes
1 answer

I am unable to use Reddit's APIs to log in

I'm trying to use the Reddit API to do some stuff. I have everything working but changing pages and logging in. I need to login to use my program, I know how to use the cookie I get, but I just can't manage to login. Here's the code: public static…
André Snede
  • 9,899
  • 7
  • 43
  • 67
5
votes
1 answer

Learning the reddit JSON API using Apigee. How do I submit a story?

Accordng to https://github.com/reddit/reddit/wiki/API I need to: "Post the following to http://www.reddit.com/api/submit: uh=f0f0f0f0&kind=link&url=yourlink.com&sr=funny &title=omg-look-at-this&id%23newlink&r=funny&renderstyle=html I believe uh is…
dot
  • 2,823
  • 7
  • 38
  • 52
1 2
3
84 85