Questions tagged [praw]

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

praw
Filter by
Sorted by
Tagged with
0 votes
0 answers
59 views

Error when using Reddit and Tumblr API to receive a reddit url and post it as a tumblr image

I am writing a script that takes some posts from a specified subreddit and then using that url to create an image post on tumblr usin both sites api's and python. My issue is that when i attempt to ...
grateful_math's user avatar
-1 votes
1 answer
735 views

I want to set flair to my reddit post using PRAW, can someone suggest solution to it?

I'm learning PRAW API to create bot to autopost things on my subreddit and script it working fine except flair setting. I tried to use this line to set flair: reddit.subreddit(sub_reddit).flair.set('...
GigaByte's user avatar
  • 700
1 vote
0 answers
198 views

Time.sleep() suspending the execution - Python

So I'm making a Reddit Bot in Python, using the code from this repository. And its working fine. But as per Reddit guidelines, I can comment only every 10 minutes. So I'm using a for loop here and ...
Debadri Dutta's user avatar
0 votes
1 answer
233 views

How To Timeout PRAW Stream When A Search Not Successfull

I just begin to use PRAW and fascinating with it. I am trying to search r/all for a matching submission title. If the search successfull my code will proceed and break in the first match, and then ...
Drunken M's user avatar
  • 2,313
0 votes
1 answer
763 views

How to get ALL submissions and comments posted by a list of redditors?

I need to get all the submissions and comments posted on Reddit for a list of usernames. I've created a redditor instance in PRAW: import praw reddit = praw.Reddit(client_id='client_id', ...
msmazh's user avatar
  • 855
4 votes
1 answer
110 views

Is there a way to combine posts/comment streams?

In praw, I can create either a subreddit.stream.comments() or subreddit.stream.submissions(). For those unfamiliar, the two above praw functions return comments/posts as they come in. Is there a ...
kpaul's user avatar
  • 355
3 votes
2 answers
2k views

Reddit PRAW API: Extracting entire JSON format

I am working on Sentiment Analysis using The Reddit API Praw. My code is below: #!/usr/bin/env python # -*- coding: utf-8 -*- import praw from IPython import display from nltk.sentiment.vader import ...
La_haine's user avatar
  • 339
1 vote
0 answers
111 views

Making a bot with PRAW. It seems to ignore some people?

my first post here. If you check out /r/EDH right now you'll see my bot on the front page. The idea is that when you type ?edhbot [name of a card]? it gives you links to relevant pages on edhrec.com. ...
Coen Dalby's user avatar
0 votes
0 answers
322 views

reddit praw scraping removing emoji and whwat encode to use

Hey guys so i have this text file which i scrape from reddit using reddit praw: Is that intended or a bug? WHAT. I’m on the way to my pubs. Does first hit desolator remove ti shuffle thread? 🤔🤔...
user3646742's user avatar
0 votes
1 answer
565 views

Python Key Error Appending Dictionary to Dictionary with list

I'm losing my mind here. What I am trying to do here is pull up a Reddit threads from a csv file that is already generated, then pull the title of the thread, the number of comments, and the current ...
Kenny Jeannite's user avatar
0 votes
1 answer
101 views

Reddit bot only fetches new posts when run, but doesnt actively fetch posts that are made while bot is already running

I started with python a little while ago, and I made a simple bot for Reddit. Unfortunately, the functionality of the bot only works on posts that are made before the bot is run in terminal. If a post ...
Bryn's user avatar
  • 9
1 vote
1 answer
28 views

Python Praw TypeError: not all arguments converted during string formatting

I wasn't getting this message when I was running the script earlier...and now I am. What am I missing? comments.reply("__%s__","\n","Current Temp: %s\u00b0F" % (str(cityname),temp_f))
stevo's user avatar
  • 108
2 votes
1 answer
1k views

Error: Arrays must be the same length

I am trying to write a script to download images from Reddit using praw, saving the images to a folder of my choice, and exporting a .csv of the results. I think I have coded it right since the ...
cipherbear's user avatar
3 votes
1 answer
227 views

Reddit Python Bot, why is it unsafe to store login credentials in the script?

I'm following along this tutorial: http://pythonforengineers.com/build-a-reddit-bot-part-1/ and in the Create Reddit App subsection it states that I should not have any login credentials directly in ...
CerealPython's user avatar
-3 votes
3 answers
192 views

Error: unindent does not match any outer indentation level (Making a reddit bot) [duplicate]

So, I'm new to Python in all. I tried my hand at making a reddit bot, I fixed most errors. But this one kinda started beating my head in as I tried fixing it. print("String with \"best girl\" found ...
Cipher The Universe's user avatar
1 vote
0 answers
49 views

User's saved items - category is None?

I would like to get the category for my saved items, but it looks like it's not working. An example: I expect to get the title and "youtube" for the category. import praw from praw.models import ...
Arklur's user avatar
  • 173
0 votes
2 answers
264 views

How to filter out specific strings from a string

Python beginner here. I'm stumped on part of this code for a bot I'm writing. I am making a reddit bot using Praw to comb through posts and removed a specific set of characters (steam CD keys). I ...
Synik's user avatar
  • 141
0 votes
2 answers
203 views

Ignore case sensitivity keyword set

I'm trying to ignore case sensitivity when searching for keywords on specific subreddits, using PRAW. def run_bot(r, comments_replied_to): print "Obtaining 25 comments..." keywords = {"...
Cameron Getty's user avatar
0 votes
1 answer
699 views

Monitor multiple keyword strings in a list using PRAW

I'm trying to use PRAW to setup a bot that automatically searches keywords in the comment body of particular subreddits. The bot will then form a reply. Right now, I only have one keyword to search ...
Cameron Getty's user avatar
2 votes
2 answers
1k views

How do I check if text contains a specific word or similar?

I'm really new to python and I was wondering if a text is inputted, can I use sequencematcher to check if the text contains a certain word or another word that is 80% similar or above. For example if ...
Alvie Mahmud's user avatar
0 votes
1 answer
872 views

Faster way to choose a random post from reddit using PRAW in an asynchronous environment

Is there fastest way to get a random post from the "hot" category of a chosen subreddit using PRAW because the code I have can take up to 3 seconds. I tried reducing the range with randint but it's ...
user avatar
3 votes
1 answer
276 views

PRAW - 500 HTTP Response error

So, I'm hosting a discord.py bot on Heroku, and I'm trying to use PRAW to take a random submission from the hot section of the subreddit. if message.content.startswith("~reddit"): subreddit = ...
High Templar's user avatar
-1 votes
1 answer
88 views

How to compare a date to a time in python?

I'm making a bot for /r/MemeEconomy and was wanting to get how old the post is and see if its older than 25 seconds (for testing purposes). for submission in subreddit.new(limit=10): ...
Mitchell Durbin's user avatar
0 votes
1 answer
2k views

Getting the: " FileNotFoundError: [Errno 2] No such file or directory: 'posted.txt '" even though I do have such file

Hey guys so I am working on a twitter bot that takes posts from reddit and tweets them. My problem right now is when I run it I get the " FileNotFoundError: [Errno 2] No such file or directory: '...
Ali Halawa's user avatar
0 votes
1 answer
101 views

Web Scraping images (Beautiful Soup) into a directory with one function, trying to append those images into a list in another function, struggling

So I am trying to add each image from each reddit post that I extract and store in a directory with Beautiful soup into my list "post_imgs" This is only part of my program, not the complete thing. I'm ...
Ali Halawa's user avatar
0 votes
2 answers
133 views

Adding a reply counter to a reddit bot

I have a bot that responds to comments/replies that include certain key words. To prevent people from spamming the bot, i want to add a counter so that when the counter reaches a certain number, for ...
Oğuzhan Esen's user avatar
2 votes
1 answer
853 views

Python reddit API: efficiently parse all comments in a subreddit

I am trying to code a chatbot and to have it scanning through all the comments added to it. Currently I do so by scanning every X seconds to the last Y comments: handle = praw.Reddit(username=config....
Learning is a mess's user avatar
1 vote
1 answer
444 views

Working with mod.log in praw

I'm working on a bot that will search the moderation log on reddit for removal actions, but am coming up short on documentation for the subreddit().mod.log() method. As of right now, all I can ...
jacksonwelsh's user avatar
2 votes
1 answer
3k views

Trying to Scrape Reddit with praw.Reddit

Im trying to scrape Reddit with the praw.reddit command and I keep getting the following: prawcore.exceptions.OAuthException: unauthorized_client error processing request (Only script apps may use ...
bullybear17's user avatar
0 votes
1 answer
509 views

How to get oldest submissions with PRAW

I have been reading through the PRAW documentation and I can find how to get the new submissions using reddit.subreddit("mysubreddit").stream.submissions() but is there a way to get submissions ...
dangee1705's user avatar
  • 3,461
0 votes
1 answer
115 views

How to keep python programming running constantly

I made a program that grabs the top three new posts on the r/wallpaper subreddit. It downloads the pictures every 24 hours and adds them to my wallpapers folder. What I'm running into is how to have ...
Nat's user avatar
  • 55
3 votes
2 answers
1k views

Can you stream posts that have made it to "hot"?

So let's say that I want to stream posts from the subreddit "news". However the posts are very frequent and we can't say that every post is worthy. So I would like to filter the good posts by trying ...
Huzo's user avatar
  • 1,672
1 vote
1 answer
3k views

UnicodeDecodeError: Unexpected end of data issue

I am currently extracting comments from various subreddits on Reddit using praw and trying to calculate their sentiment and add them to a database. It works by reading from a file that contains ...
Rachel Solomon's user avatar
0 votes
2 answers
1k views

PRAW: export to data table with pandas or other; open to suggestions

I have the following code which uses a python script, calls praw and returns text from a reddit page. I now want to: Be able to get more comments as it only outputs a small amount. I want the see ...
Swan's user avatar
  • 1
0 votes
1 answer
160 views

Getting no attribute reply when running praw on Python Everywhere

I am trying to run a bot on pythoneverywhere, I currently run it on my pc but I want to move it to the cloud. When it tries to comment on a post I get the error, AttributeError: 'class 'praw.objects....
Jakub Koziol's user avatar
5 votes
4 answers
1k views

"AttributeError: '_NotSet' object has no attribute 'lower'" when a PRAW python file is converted to an exe using Pyinstaller

As the title says. When I execute the converted python file (the .exe) I get the following output: Traceback (most recent call last): File "background.py", line 10, in <module> File "site-...
Recessive's user avatar
  • 1,869
1 vote
1 answer
735 views

Why is the object called "module" not callable?

I'm trying to make a bot that replies to comments on Reddit but I've been getting this error and I don't know what to do this is the error I get: Traceback (most recent call last): File "F:\Python\...
Calw's user avatar
  • 45
0 votes
2 answers
16k views

How do I get a random subreddit image to my discord.py bot?

I am making a discord bot in async python. I want the bot to post a random picture when I do a command (prefix !) example !meme. This would bring up a random picture from a subreddit, in this case the ...
Alex Wollan's user avatar
2 votes
2 answers
1k views

Python praw reddit api: Reliably get posts as they are posted

At the moment I have a script that queries some subreddits every 30 seconds and returns the newest submission: while True: for post in reddit.subreddit(query_list).new(limit=1): if ...
Sam's user avatar
  • 2,180
2 votes
1 answer
2k views

Can't import praw in Python3

I've been writing a reddit bot for a while now and recently moved it to a different system. There I've installed the same packages as on the previous system. The bot is Python3 based so I install ...
boolean.is.null's user avatar
0 votes
1 answer
1k views

PRAW - searching for NSFW submissions

I'm noticing that nsfw posts are not showing up when using the search method on a subreddit. for submission in self.reddit.subreddit('nsfw_subreddit').search('a'): print(submission.title)...
JC1's user avatar
  • 869
0 votes
0 answers
221 views

Having trouble installing praw

So I'm trying to make a Reddit bot so I have to install praw. the problem is I keep getting this error message: matplotlib 1.3.1 requires nose, which is not installed. matplotlib 1.3.1 requires ...
Daan Koning's user avatar
3 votes
1 answer
283 views

Get all submissions from a subreddit without 'submissions'

Is there any way to get all submissions from a subreddit without using the function submissions() from PRAW? With submissions i was able to search all submission from a given subreddit between two ...
Torb's user avatar
  • 279
0 votes
1 answer
86 views

Writing Reddit Automatic Bot code, Not commenting all parts of a list

So im writing a bot for a subreddit I moderate in python. The Bot is able to execute, and is able to reply to the comment correctly, except that it only replies with the final part of the list .(the ...
crazy_angel's user avatar
0 votes
1 answer
125 views

Authentication issue with Reddit bot

I am having an issue creating a Reddit session via my script for a bot. I have installed praw via pip and have created a praw.ini file in the same directory as my bot script: [DEFAULT] # A boolean to ...
Fleming Slone's user avatar
2 votes
1 answer
307 views

How to implement a DFS to the Reddit PRAW?

I would like to implement a DFS to get a parent and child conversation in the Reddit API. I'm totally lost on how to do this. Any pointers?
user3646742's user avatar
0 votes
1 answer
30 views

matching subreddit with submission with PRAW in Python

I want to collect the stream of all reddit submissions with their corresponding subreddits. With the following structure: Column1 = subreddit ; column2 = submission title I now have the following ...
Julius Sytstra's user avatar
0 votes
1 answer
869 views

"ImportError: No module named praw" error when running python script in crontab

I have a python script that uses praw. When I run the script it works perfectly, but when I try to run in through crontab I continue to get: import praw ImportError: No module named praw I've tried ...
perksofthesewalls's user avatar
2 votes
1 answer
741 views

Scraping all data from Reddit searches

I am using PRAW to scrape data off of reddit. I am using the .search method to search very specific people. I can easily print the title of the submission if the keyword is in the title, but if the ...
e.russett's user avatar
0 votes
1 answer
170 views

PRAW Errors updating to new Python Distro

So I am trying to create a bot that cross posts from a sub (r/pics) to (r/polpics) using a bit of code from u/GoldenSights. I upgraded to a new python distro and I get a ton of errors, I don't even ...
Tony Cossio's user avatar

1
6 7
8
9 10
13