Questions tagged [praw]

PRAW (Python Reddit API Wrapper) is a python package used to access and interact with the reddit API.

PRAW, short for Python Reddit API Wrapper, is a python package that allows for simple access to ’s API. PRAW aims to be as easy to use as possible and is designed to follow all of reddit’s API rules. You have to give a useragent that follows the rules, everything else is handled by PRAW so you needn’t worry about violating them.

617 questions
3
votes
2 answers

Getting all submissions for the past two months from a particular subreddit (using PRAW)?

I was trying to get all the /r/politics posts for the last two months with all the comments and the user details. How do I do this using PRAW? Should I go through the posts in get_hot()? Any ideas on how to go about this? Are there any time-stamp…
bazzi
  • 559
  • 1
  • 8
  • 23
3
votes
2 answers

Praw: How to filter search results based on created date?

I want to have a script running in the background which will fetch subreddit data every hour or so. Now since I don't want duplicate entries in my db, I want to filter my search results based on created_utc This is what I have currently: r =…
90abyss
  • 7,037
  • 19
  • 63
  • 94
3
votes
2 answers

subreddits of user using PRAW or R

How to get subreddits of a redditor from PRAW using python or RedditextractoR package in R. Iam using these comments for sentiment analysis using reddit and need subbreddits a particular user is involved in. I got comments posts and users using…
3
votes
2 answers

How do I use PRAW and python to retrieve reddit post data from a certain user?

Python version : 2.7 I am trying to retrieve posts from a Reddit user and store them in python into a variable. Below is an example of what I am trying to accomplish. It should get ALL posts from the user. Please note that most of the below code,…
jaesson1985
  • 718
  • 2
  • 11
  • 19
2
votes
1 answer

praw: Get body and title of random post in subreddit

I'm trying to print out the title along with the content (body) of a random post on a given subreddit. I've been looking around all over the internet on how to do this, but I cant seem to figure it out. I've written something down here that gets the…
Sem
  • 21
  • 2
2
votes
1 answer

UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f937' in position 0: character maps to

I am currently working on an application which grabs data from subreddits and writes them into an text file. When starting my script I am running in the following error: File "my_file.py", line 35, in data.writelines('parent_id: '+…
user15309583
2
votes
2 answers

Can I read reddit video info using praw?

I am learning to use PRAW to do configuration or read information on reddit through python. Now I want to read the video contents online (size, duration, etc) (I uploaded one video from my account as a test video), which instance should I use and…
orc318
  • 21
  • 1
2
votes
2 answers

Praw: How to get top posts that were created in last 24 hours?

I want to get top posts of a subreddit but I only get top posts of all time. How to filter the search results so it only looks for today posts? My code: top_memes = subreddit.top(limit=5) for submission in top_memes: print(submission.title)
F8te
  • 129
  • 1
  • 1
  • 9
2
votes
1 answer

How to find out the name of Redditor in PRAW?

How do I find out the name of a Redditor in PRAW from a comment he made. For example, If a user comments something with the bot's keyword, they will reccive a PM. To send this the redditor's name must be obtained. I have tried using the following…
2
votes
1 answer

Retrieving all comments from a thread on Reddit

I’m new to API’s and working with JSON and would love some help here. I know everything I’m trying to accomplish can be done using the PRAW library, but I’m trying to figure it out without PRAW. I have a for loop that pulls post titles from a…
Hausra5
  • 31
  • 4
2
votes
1 answer

How do you extract reddit submission content with praw?

I'm working on a Discord bot right now, where one of its commands brings up a random submission from the r/copypasta subreddit. Right now, my code is as follows: @client.command(help = 'sends you a link to a copypasta... working on making it an…
2
votes
0 answers

praw reddit library: possible to create non-custom reports?

I'm trying to make a bot that auto reports posts in r/NoNewNormal. I'm running my bot with praw but I can't figure out how to make non-custom reports. It throws an exception for this subreddit because custom reports are not allowed in r/NoNewNormal.…
Alex Rumer
  • 43
  • 1
  • 8
2
votes
0 answers

prawcore.exceptions.NotFound: received 404 HTTP response

Hey guys I'm having trouble figuring this out: Traceback (most recent call last): File "SOLIS.py", line 62, in com_df1 = scraper.comments(sub_id_list,keywords1,keywords2) File "/Users/CarranzaEE/Desktop/CDS…
ecarran3
  • 21
  • 1
2
votes
1 answer

prawcore.exceptions.OAuthException error even though I checked credentials

I am getting a credential error but I am not understanding why. I feel as though I've triple checked that they are correct and also manually logged in. My code is shown below import os from dotenv import load_dotenv import praw load_dotenv() reddit…
hope288
  • 725
  • 12
  • 23
2
votes
1 answer

Python times out after if in for loop

F.W. This isn't just a PRAW question, it leans toward Python more than PRAW. Python people are welcome to contribute, and please note this is not my mother language xD! Essentially, I'm writing a Reddit bot using the PRAW that does the…
Bobbbay
  • 322
  • 6
  • 18