r/learnprogramming • u/kindw • Aug 13 '17
I asked about making a detailed post about writing a Reddit bot with Python yesterday and received a lot of responses. So here it is - How to make a Reddit bot with Python including the process, practices and tools.
36
u/NotLaddering3 Aug 13 '17
This is exactly what I was looking for after getting tired of all the other resources that wont let you do anything
12
228
u/Double_O_Zero Aug 13 '17
Dear /u/kindw,
This is an automated message from Carls Junior.
Our recent sighting of your activity on https://Reddit.Com/r/LearnProgramming as well as our data analytics on you and your "other" Internet activities has left us no choice; we must flag your account as a potential threat to civilized human life. This analysis finds you in violation of The Civilized User Agreement of the international control board, founded in 2490 by the United Nations of Apple-Google-Carls Junior.
Effective immediately, you are to report to your nearest Carls Junior for euthanasia. Have a nice day.
65
u/kindw Aug 13 '17 edited Aug 13 '17
https://gfycat.com/BonyBruisedBlowfish
Edit: Fixed link
12
u/cdown13 Aug 13 '17
As someone who identifies as a bony bruised blowfish that url has offended me. My size is not restricted!
14
→ More replies (1)2
16
u/shadowfactsdev Aug 13 '17
Looks good! The one suggestion I have is to, in the comment parsing code, instead of parsing the number yourself using a Regex capturing group.
This is my replacement Regex which incorporates the capturing group as well as the changes you mentioned (optional https and www.) with a couple other things like escaping periods.
8
u/kindw Aug 13 '17
Thanks for your suggestion. I really appreciate it.
I did not implement an advanced regex as I was looking for people to come out with them, so that they can get an understanding of how a regex can be improved. I'll look into your implementation, and possibly push it to the repo.
1
u/kpagcha Aug 14 '17
What does this do
(?:www\.)?? What I make out of it is that(?)?is a non-capturing group. But if I remove both question marks (making it a normal capturing group), all maches fail.1
u/shadowfactsdev Aug 14 '17
That bit is a non-capturing group matching the literal
www.the entirety of which is optional.If you remove the
?:from after the opening paren, that changes the group to be a capturing group, so group 1 will bewww.and group 2 will be the number. (I think the issue that you ran into is that you need to remove the:as well, both the?:make the group non-capturing, and if you remove just the?, the:will be part of the match.)If you remove the second
?from after the group, it makes the group non-optional, meaning that the URL must contain thewww.prefix beforexkcd.com.→ More replies (1)
5
6
u/mrat85 Aug 13 '17
Thanks for putting this together! Just getting started and haven't spent much time with Python but seems like a nice reach project as I learn.
6
3
u/ThePeskyWabbit Aug 15 '17
you say remember we created a praw.ini earlier but i never saw any reference to that prior.
1
u/kindw Aug 15 '17
1
1
u/GitHubPermalinkBot Aug 15 '17
I tried to turn your GitHub links into permanent links (press "y" to do this yourself):
Shoot me a PM if you think I'm doing something wrong. To delete this, click ^here.
2
•
u/michael0x2a Aug 14 '17 edited Sep 20 '17
Edit: Unfortunately, even after a month after this tutorial was posted, we (as well as moderators of other subreddits) have seen a distinct uptick in bots that do not follow bottiquette and post unwanted and low-effort content. While there's no inherent issue with teaching people how to program via practical examples, we feel that shouldn't come at the expense of others. Consequently, we're removing this post in an effort to help minimize this (unfortunate), ongoing behavior.
4
52
Aug 13 '17
And thus the flood gates opened and thousands of bots stormed the shores of various subreddits. What humankind does with knowledge more often than not leads to his own downfall.
16
u/kent_eh Aug 14 '17
Yeah, I would like to see a 3rd bullet under "important information - please read"
3: please make your bot opt-in for subreddits, and not "opt out". Not every subreddit wants to be overrun by random bots, and if you piss off enough people they'll complain to the admins and try to get you banned.
9
u/Itsthejoker Aug 14 '17
Or just "This is botiquette. Read it. Know it. Allow it to fill your whole being. Bots that do not follow this document will be hated by basically everyone and reported to the admins."
2
2
2
Oct 10 '17
What humankind does with knowledge more often than not leads to his own downfall
Basically every Civ quote
42
34
u/LizardOrgMember5 Aug 13 '17 edited Aug 13 '17
Huh. I made a Reddit bot yesterday. And it was a coolest thing I have ever done. What a coincidence. But I haven't fully implemented in a website yet. And I still need more ideas for better bot as well.
12
36
u/-BookBot- Aug 13 '17
What a coincidence, I made a bot today, before seeing this post. Check it out!
!book Crime and punishment
24
u/-BookBot- Aug 13 '17
Crime and Punishment by Fyodor Dostoyevsky. (4.18/5 *) Link
Through the story of the brilliant but conflicted young Raskolnikov and the murder he commits, Fyodor Dostoevsky explores the theme of redemption through suffering. Crime and Punishment put Dostoevsky at the forefront of Russian writers when it appeared in 1866 and is now one of the most famous and influential novels in world literature.The poverty-stricken Raskolnikov, a talented student, devises a theory about extraordinary men being above the law, since in their brilliance they think “new thoughts” and so contribute to society. He then sets out to prove his theory by murdering a vile, cynical old pawnbroker and her sister. The act brings Raskolnikov into contact with his own buried conscience and with two characters — the deeply religious Sonia, who has endured great suffering, and Porfiry, the intelligent and discerning official who is charged with investigating the murder — both of whom compel Raskolnikov to feel the split in his nature. Dostoevsky provides readers with a suspenseful, penetrating psychological analysis that goes beyond the crime — which in the course of the novel demands drastic punishment — to reveal something about the human condition: The more we intellectualize, the more imprisoned we become.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
7
Aug 13 '17
!book The Kite Runner
9
u/-BookBot- Aug 13 '17
The Kite Runner by Khaled Hosseini. (4.26/5 *) Link
“It may be unfair, but what happens in a few days, sometimes even a single day, can change the course of a whole lifetime." Amir is the son of a wealthy Kabul merchant, a member of the ruling caste of Pashtuns. Hassan, his servant and constant companion, is a Hazara, a despised and impoverished caste. Their uncommon bond is torn by Amir's choice to abandon his friend amidst the increasing ethnic, religious, and political tensions of the dying years of the Afghan monarchy, wrenching them far apart. But so strong is the bond between the two boys that Amir journeys back to a distant world, to try to right past wrongs against the only true friend he ever had.The unforgettable, heartbreaking story of the unlikely friendship between a wealthy boy and the son of his father’s servant, The Kite Runner is a beautifully crafted novel set in a country that is in the process of being destroyed. It is about the power of reading, the price of betrayal, and the possibility of redemption; and an exploration of the power of fathers over sons—their love, their sacrifices, their lies.A sweeping story of family, love, and friendship told against the devastating backdrop of the history of Afghanistan over the last thirty years, The Kite Runner is an unusual and powerful novel that has become a beloved, one-of-a-kind classic.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
19
5
Aug 13 '17
!book Lord of Light
→ More replies (7)6
u/-BookBot- Aug 13 '17
Lord of Light by Roger Zelazny. (4.10/5 *) Link
Earth is long since dead. On a colony planet, a band of men has gained control of technology, made themselves immortal, and now rule their world as the gods of the Hindu pantheon. Only one dares oppose them: he who was once Siddhartha and is now Mahasamatman. Binder of Demons, Lord of Light.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
→ More replies (3)3
→ More replies (2)5
u/FRED_PENNER_CORE Aug 13 '17
!book armed to the teeth with lipstick
40
u/-BookBot- Aug 13 '17 edited Aug 13 '17
You made the bot crash! I hope you're happy.
Just kidding, let me find what is wrong.
Edit: So goodreads allows books without description, and as my code was expecting one to exist, it just crashed. Thank you! :)
→ More replies (7)9
u/-BookBot- Aug 13 '17
Armed To The Teeth With Lipstick by Blag Dahlia. (3.80/5 *) Link
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
6
Aug 13 '17
Question for you: would it be better to have the bot reply to people "summoning" it so to speak like so: /u/-BookBot- rather than have it monitor some subreddits?
I've never made a reddit bot so I'm not sure what the pros/cons would be.
1
u/-BookBot- Aug 13 '17
Yes, but I think It would be more difficult for the users, and some subreddits don't allow bots, so it would be banned in a lot of places! Maybe I'll do it.
→ More replies (2)1
u/turunambartanen Aug 15 '17
You would have to check you inbox (the bot on his account i mean) regulary. However that would be done...
→ More replies (2)4
u/DanjuroV Aug 13 '17
!book A Parent's Guide to Preventing Homosexuality
3
u/-BookBot- Aug 13 '17
A Parent's Guide to Preventing Homosexuality by Joseph Nicolosi. (1.47/5 *) Link
Homosexuality: is it learned, biological or both?The answer to this question deeply concerns parents. They want to know how they can best raise their children. A common belief today is that nothing can be done to foster the development of healthy heterosexual orientation in children. But the clinical experience and professional research of Dr. Nicolosi and others indicates otherwise.In this groundbreaking book Joseph and Linda Ames Nicolosi uncover the most significant factors that contribute to a child's healthy sense of self as male or female. Listening to moving recollections from ex-homosexual men and women who describe what was missing in their own childhoods, the Nicolosis provide clear insight for identifying potential developmental roadblocks and give practical advice to parents for helping their children securely identify with their gender.Replete with personal stories from parents, children and ex-homosexual strugglers, offers compassion and hope for all those parents who seek to lay a foundation for a healthy heterosexual identity in their children.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
3
2
u/dzil123 Aug 13 '17
!book stuff matters
2
u/-BookBot- Aug 13 '17
Stuff Matters: Exploring the Marvelous Materials That Shape Our Man-Made World by Mark Miodownik. (4.06/5 *) Link
A New York Times BestsellerAn eye-opening adventure deep inside the everyday materials that surround us, packed with surprising stories and fascinating science Why is glass see-through? What makes elastic stretchy? Why does a paper clip bend? Why does any material look and behave the way it does? These are the sorts of questions that Mark Miodownik is constantly asking himself. A globally-renowned materials scientist, Miodownik has spent his life exploring objects as ordinary as an envelope and as unexpected as concrete cloth, uncovering the fascinating secrets that hold together our physical world. In Stuff Matters, Miodownik entertainingly examines the materials he encounters in a typical morning, from the steel in his razor and the graphite in his pencil to the foam in his sneakers and the concrete in a nearby skyscraper. He offers a compendium of the most astounding histories and marvelous scientific breakthroughs in the material world, including:The imprisoned alchemist who saved himself from execution by creating the first European porcelain.The hidden gem of the Milky Way, a planet five times the size of Earth, made entirely of diamond.Graphene, the thinnest, strongest, stiffest material in existence—only a single atom thick—that could be used to make entire buildings sensitive to touch.From the teacup to the jet engine, the silicon chip to the paper clip, the plastic in our appliances to the elastic in our underpants, our lives are overflowing with materials. Full of enthralling tales of the miracles of engineering that permeate our lives, Stuff Matters will make you see stuff in a whole new way.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
→ More replies (8)2
u/Cache_of_kittens Aug 13 '17
!book deadhouse gates
3
u/-BookBot- Aug 13 '17
Deadhouse Gates (The Malazan Book of the Fallen, #2) by Steven Erikson. (4.25/5 *) Link
In the vast dominion of Seven Cities, in the Holy Desert Raraku, the seer Sha’ik and her followers prepare for the long-prophesied uprising known as the Whirlwind. Unprecedented in size and savagery, this maelstrom of fanaticism and bloodlust will embroil the Malazan Empire in one of the bloodiest conflicts it has ever known, shaping destinies and giving birth to legends.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
Aug 13 '17
!book Make: Electronics
2
u/-BookBot- Aug 13 '17
MAKE: Electronics: Learning Through Discovery by Charles Platt. (4.23/5 *) Link
"This is teaching at its best!" --Hans Camenzind, inventor of the 555 timer (the world's most successful integrated circuit), and author of Much Ado About Almost Nothing: Man's Encounter with the Electron (Booklocker.com)"A fabulous book: well written, well paced, fun, and informative. I also love the sense of humor. It's very good at disarming the fear. And it's gorgeous. I'll be recommending this book highly." --Tom Igoe, author of Physical Computing and Making Things TalkWant to learn the fundamentals of electronics in a fun, hands-on way? With Make: Electronics, you'll start working on real projects as soon as you crack open the book. Explore all of the key components and essential principles through a series of fascinating experiments. You'll build the circuits first, then learn the theory behind them!Build working devices, from simple to complex You'll start with the basics and then move on to more complicated projects. Go from switching circuits to integrated circuits, and from simple alarms to programmable microcontrollers. Step-by-step instructions and more than 500 full-color photographs and illustrations will help you use -- and understand -- electronics concepts and techniques.Discover by breaking things: experiment with components and learn from failureSet up a tricked-out project space: make a work area at home, equipped with the tools and parts you'll needLearn about key electronic components and their functions within a circuitCreate an intrusion alarm, holiday lights, wearable electronic jewelry, audio processors, a reflex tester, and a combination lockBuild an autonomous robot cart that can sense its environment and avoid obstaclesGet clear, easy-to-understand explanations of what you're doing and why
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
u/EmeraldDS Aug 13 '17
!book The Bad Beginning
2
u/-BookBot- Aug 13 '17
The Bad Beginning (A Series of Unfortunate Events, #1) by Lemony Snicket. (3.89/5 *) Link
Dear Reader,I'm sorry to say that the book you are holding in your hands is extremely unpleasant. It tells an unhappy tale about three very unlucky children. Even though they are charming and clever, the Baudelaire siblings lead lives filled with misery and woe. From the very first page of this book when the children are at the beach and receive terrible news, continuing on through the entire story, disaster lurks at their heels. One might say they are magnets for misfortune.In this short book alone, the three youngsters encounter a greedy and repulsive villain, itchy clothing, a disastrous fire, a plot to steal their fortune, and cold porridge for breakfast.It is my sad duty to write down these unpleasant tales, but there is nothing stopping you from putting this book down at once and reading something happy, if you prefer that sort of thing.With all due respect,Lemony Snicket
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
→ More replies (2)1
1
1
u/nekobakasan Aug 14 '17
!book gates of fire
2
u/-BookBot- Aug 14 '17
Gates of Fire: An Epic Novel of the Battle of Thermopylae by Steven Pressfield. (4.40/5 *) Link
In 480 B.C., two million Persian invaders come to the mountain pass of Thermopylae in eastern Greece, where they are met by 300 of Sparta's finest warriors. The Greek loyalists battle for six days in a prelude to their ultimate victory.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
0
0
0
0
0
→ More replies (2)0
Aug 13 '17
[deleted]
1
u/-BookBot- Aug 13 '17
Breakfast of Champions by Kurt Vonnegut Jr.. (4.08/5 *) Link
In Breakfast of Champions, one of Kurt Vonnegut’s most beloved characters, the aging writer Kilgore Trout, finds to his horror that a Midwest car dealer is taking his fiction as truth. What follows is murderously funny satire, as Vonnegut looks at war, sex, racism, success, politics, and pollution in America and reminds us how to see the truth.
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
7
29
5
4
u/Gangreless Aug 13 '17
Holy shit you are awesome. I've been thinking this past week about writing a bot for reddit but had no idea how to get started. Thank you!
1
u/gulyman Aug 13 '17
How large can commented.txt get before it starts taking a while to read into memory?
3
Aug 13 '17
I wouldn't even write the Id to a text file. You could just try saving every comment you reply to, then doing a check if the comment is saved before you reply. The methods are .save() and .saved
1
u/kindw Aug 13 '17
You can do that, but accessing a local copy of comment ID is much faster than accessing the state of a comment (saved or unsaved) over the Reddit API
1
Aug 13 '17
I doubt it's a noticable slow down. Also, are you sure the save state isn't already loaded when you fetch comments, or is it a property which makes a request only when you access the attribute? If so, the only additional request is to save the comment.
1
u/kindw Aug 13 '17
I can't provide an exact figure on the size of the file without running some tests myself.
You can access the file element wise instead of loading the whole file when reading, which will be a slower process.
1
1
Aug 13 '17 edited Aug 13 '17
Can I use R to create a similar bot?
1
u/kindw Aug 13 '17 edited Aug 13 '17
You can write a bot in R. There are some Reddit API wrappers available for R, you can also check them out!
1
u/As_Your_Attorney Aug 13 '17
How kind of you, man. This is exactly what I've needed to begin learning Python. You have my gratitude.
2
1
u/krichaelsquad Aug 13 '17
Help! When I enter in the python3 botname.py command nothing happens, it seems like it's loading something, but then it just prompts me right back to terminal line.
1
u/kindw Aug 13 '17
Can you post the code you are trying to run
1
u/krichaelsquad Aug 13 '17
As in what I'm putting into the terminal or my .py file?
1
u/kindw Aug 13 '17
Your .py file
1
u/krichaelsquad Aug 13 '17
→ More replies (1)3
u/kindw Aug 13 '17 edited Aug 13 '17
You should not be using
reif you are not looking to detect patternsTry replacing this block:
match = re.findall("Hey Todd!") if match:With:
if 'Hey Todd!' in comment.body:1
1
u/FiveYearsAgoOnReddit Aug 14 '17
Which version on Python should people use for this code? There are big differences between Python 2 and 3, right?
2
u/kindw Aug 14 '17
1
u/GitHubPermalinkBot Aug 14 '17
I tried to turn your GitHub links into permanent links (press "y" to do this yourself):
Shoot me a PM if you think I'm doing something wrong. To delete this, click ^here.
1
u/raidicy Aug 16 '17
Thank you very much for the tutorial, there's some really good stuff here. Anytime you want to make some tutorials I'm willing to follow them!
I can get the bot to find the comments, print them out, and it says it replies to them. The praw API returns a post ID with a successful post, however, the bot doesn't comment on my thread. I limited the amount of comments to get and it still can't find it despite my test thread being almost brand new. Is there a way to directly use the comment ID's to find the url of the actual post. I've tried to copy and past them after the r/test/comment ID url to no avail.
1
u/kindw Aug 16 '17
Please show me the code you are trying to run. I'll try to help.
1
u/raidicy Aug 16 '17
As far as I know it's pretty much exactly the code in the tutorials. I appreciate you looking into it.
1
u/idmontie Sep 05 '17
Is there a streaming api instead of polling 250 comments at a time?
2
u/kindw Sep 06 '17
Yes there is. If you are using PRAW, the class
SubredditStreamprovides submission and comment streams. You can read the documentation here.I chose to retrieve 250 comments to maintain simplicity at the time.
1
u/idmontie Sep 06 '17
Thanks for the reply! That's great thank you. I can't believe I missed it when looking at the API.
1
1
Sep 06 '17
Thanks for posting this, I have a few questions.
First of all, does the string for user_agent come from anything, or is it just a description?
Second, when on windows, since the file path uses backslashes, should I write the path name as 'c:\users\...'?
Third, I couldn't find anything titled client_id on the app page of my reddit account. I'm assuming that the id is the string under the words 'personal use script.' Is that correct?
Again, thank you so much for writing this up, I'm really trying to learn more about applying what I know about coding to real projects. This helps so much.
1
u/kindw Sep 06 '17
The user_agent is a descriptive string. See this for more information.
The path should specify the location of the file, and it can take any form depending on your machine
Yes, the client_id is the string under the words 'personal use script'
3
u/HeXagon_Prats Aug 13 '17
!author Ernest Cline
4
u/-BookBot- Aug 13 '17
Ready Player One by Ernest Cline. (4.31/5 *) Link
Armada by Ernest Cline. (3.49/5 *) Link
The Importance of Being Ernest by Ernest Cline. (3.94/5 *) Link
Ernest Cline by Jesse Russell. (5.00/5 *) Link
Summary of Ready Player One: by Ernest Cline | Summary & Analysis by aBookaDay. (4.18/5 *) Link
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
u/nwL_ Aug 13 '17
!author Rick Riordan
1
u/-BookBot- Aug 13 '17
The Lightning Thief (Percy Jackson and the Olympians, #1) by Rick Riordan. (4.23/5 *) Link
The Sea of Monsters (Percy Jackson and the Olympians, #2) by Rick Riordan. (4.23/5 *) Link
The Battle of the Labyrinth (Percy Jackson and the Olympians, #4) by Rick Riordan. (4.39/5 *) Link
The Lost Hero (The Heroes of Olympus, #1) by Rick Riordan. (4.35/5 *) Link
The Last Olympian (Percy Jackson and the Olympians, #5) by Rick Riordan. (4.50/5 *) Link
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
u/EmeraldDS Aug 13 '17
!author Edgar Allen Poe
1
u/-BookBot- Aug 13 '17
The Dreamer: Edgar Allen Poe by Mary Newton Stanard. (3.86/5 *) Link
The Works of Edgar Allen Poe by Edgar Allan Poe. (4.44/5 *) Link
The Works of Edgar Allen Poe: Volume 1 by Edgar Allan Poe. (4.30/5 *) Link
Great Works of Edgar Allen Poe by Edgar Allan Poe. (4.40/5 *) Link
The Zebra by LoyalLiar. (4.33/5 *) Link
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
3
u/thavi Aug 13 '17
You need to start a blog/website! If you can contribute knowledge like this it deserves to be enclosed in something more withstanding than reddit post!
2
u/GoBuffaloes Aug 13 '17
Nice work. I avoid the Requests library because it doesn't play nice with JavaScript. I built a bot to do mock fantasy football drafts on the ESPN website and put in several hours before getting to the final step and having to start over because they arbitrarily decided to use a JS button instead of an HTML button.
Selenium-webdriver is the way to go IMO
2
u/TalkingToMyselff Aug 13 '17 edited Aug 13 '17
EDIT Nevermind, solution found. I was making a simple mistake when trying to convert from bytes to string.**
First of all, thank you for this post. We all appreciate the time and effort you put into this.
I do have a question though. I feel like this is a simple problem, but I've been struggling to find a solution. My bot is supposed to return price information of trading cards. I'm using yugiohprices api to get the information.
I'm trying to use: JData = json.loads(myResponse.content)
The issue is that the response is given in bytes and needs to be a string. I've tried a few ways to convert bytes to string but haven't been successful. I really do appreciate any help, thanks in advance.
2
u/iamonlyoneman Aug 14 '17
thanks for the comments about using r/test
. . . and section 1 has a typo, out instead of our
2
u/FiveYearsAgoOnReddit Aug 14 '17
Why do you have this in your regular expression before https://www.xkcd.com? I don't see why it needs to be there.
[a-z]*[A-Z]*[0-9]*2
2
u/badbigfox Sep 20 '17
It's been removed, what happened?
2
u/Viginti Sep 20 '17
Still cached on Google. Copy the post title and paste it into google...
1
3
3
u/flappyduck Aug 13 '17
Que Reddit getting spammed by thousands of home made bots - maybe this is how Skynet is born...
3
2
u/CTU Aug 13 '17
Remindme! 24 hours "read and maybe try"
→ More replies (2)8
u/TechLaden Aug 13 '17
No need to include a 'maybe' in there - we're all here to learn and willing to help each other out of you're stuck :-)
→ More replies (1)
1
1
Aug 13 '17
I was just looking for this as a way to start out in Python (and really something other than Powershell) and it is great. Thank you for putting work into this.
1
1
u/phantom667 Aug 13 '17
This looks great! I've been looking for some fun project ideas to help me learn Python. Thanks for the write-up.
1
1
u/SenpaiSoren Aug 13 '17
....this would've been helpful a week or two ago when I made /u/me_irl-meme_bot. Oh well.
1
1
u/stephenrhill Aug 13 '17
I'm going to do it. First question what is a Reddit Bot? Second question, what do pythons eat?
1
u/willed11 Aug 13 '17
I need someone to build me an auto checkout bot for an art website that I frequent. The small edition sizes makes it nearly impossible to score because other users are using bots.
1
u/GreatBeingHuman Aug 14 '17
Thank you so much for this. I've always wanted to learn python and this looks like a fun project.
1
1
u/The_Rogue_Coder Aug 14 '17
Looking forward to trying this out in the near future, thanks for posting it!
1
1
u/guinader Aug 14 '17
Oh man! This is going to be one of my goals. I'm currently still learning c# but i fiddle with phyton which will be my next language to learn. Then I'll get to it as one of my first thing ls to build
1
1
1
1
u/starstorm312 Aug 14 '17
Nice work! I'm definitely recommending this post to programming newbies since your explanations were so lucid.
1
1
u/KegsInWall Aug 14 '17
Been wanting to do some python for a while and this seems like a great into. Thanks!
1
1
u/novarising Aug 15 '17
Hi, I'd like to know why does it take so long to check whether a comment as already been replied to. To me it seems like it should be extremely fast, it just has to open a 1KB txt file and check whether it has some number in it or not. But it takes anywhere from 5-15 seconds for me.
Thanks for the nice tutorial, built a nice bot with this. :)
1
1
1
u/boydo579 Aug 17 '17
Would anyone be interested in a group project to make a r/popular/all bot for posts from r/Sweden?
Basically:
Read title, translate (google translate or whatever), add to comment.
Read comments above certain upvote count or top comments after x hours, translate, add to comment.
Maybe some way to direct better translation to appropriate Google area.
Post.
1
u/CasualCha0s Aug 17 '17
Hi so I want to start this but I'm already having trouble installing this pip thing. Here there are two links that both are supposed to tell me how to install it but one says something about linux (I have win 10) and the other is a python file? Is there no installer? Also Pycharm shows me that the code has 5 errors and countless typos.
EDIT: Also how do I get PRAW, Python Requests and Beautiful Soup 4?
1
1
1
1
u/chosengamer Aug 24 '17
hey, so you say in step 2 that earlier you made praw.ini, but I'm not sure where you do this. Was that actually what was done in step 1, or was it in a link I missed.
1
u/ClickableLinkBot Aug 28 '17
Thank you for the guide.
I am now a fully-functional bot set on destroying humanity improving reddit usability.
Beep boop.
1
u/1Goal_1Dream Sep 20 '17
why removed ? I was just about to get it done
0
Sep 20 '17
[deleted]
1
u/1Goal_1Dream Sep 20 '17
aah thanks a lot your post reaply helped me out and got me to do something productive ;)
1
u/1Goal_1Dream Sep 20 '17
Oh I think the archive link is not working it just redirects to this post which is removed or my phone is just buggy
1
1
1
u/firestepper Aug 13 '17
Great write up! A project that I've been wanting to take on for a while now!
1
Aug 13 '17
Sweet baby Jesus. I got 5 hours left on shift with fuck all left to do.
Thank you for the exercise.
1
1
1
1
u/iternet Aug 13 '17
!book Birthright
1
u/-BookBot- Aug 13 '17
Birthright by Nora Roberts. (3.99/5 *) Link
On a hot July afternoon, a worker at an Antietam Creek construction site drives the blade of his backhoe into a layer of soil — and strikes a 5,000-year-old human skull. The discovery draws plenty of attention and a lot of controversy. It also changes the life of one woman in ways she never expected...As an archaeologist, Callie Dunbrook knows a lot about the past. But her own past is about to be called into question. Recruited for her expertise on the Antietam Creek dig, she encounters danger — as a cloud of death and misfortune hangs over the project, and rumors fly that the site is cursed. She finds a passion that feels equally dangerous, as she joins forces in her work with her irritating, but irresistible, ex-husband, Jake. And when a strange woman approaches her, claiming to know a secret about Callie’s privileged Boston childhood, some startling and unsettling questions are raised about her very identity.Searching for answers, trying to rebuild, Callie finds that there are deceptions and sorrows that refuse to stay buried. And as she struggles to put the pieces back together, she discovers that the healing process comes with consequences — and that there are people who will do anything to make sure the truth is never revealed
I'm a bot, check me out at: https://github.com/RoberTnf/BookBot
1
u/__word_clouds__ Aug 14 '17
Word cloud out of all the comments.
I hope you like it
*Disclaimer: Due to restrictions by your ISP If you click on the link, a $0.10 charge will be billed to your account
-2
207
u/-BookBot- Aug 13 '17
Hi! Great job! May I suggest that you explain a way to host your bot? As not everyone can keep their PC running forever.
I'm using AWS (free tier) for mine, but I know there are alternatives like Heroku.
BTW:
!author Tolkien
:P