r/learnpython • u/pattyperk • Sep 27 '19
I made a bot that accuses random celebrities of being in 6ix9ine's 'Nine Trey Bloods' gang.
IDK why I did this, but here it is.
Every day, it accuses the most famous person on Famous Birthdays of being in 6ix9ine's 'Nine Trey Bloods'.
Here's how it works:
Uses bs4 to scrape Famous Birthdays for celebrity name & picture.
Uses Tweepy to search Twitter for the name, returns the most relevant user (if the celeb doesn't have a twitter, it still tags the first result which is kinda funny).
Uses Tweepy to attach media & tweet.
p@
2
u/oramirite Sep 28 '19
Where do you run code like this?
1
u/pattyperk Sep 28 '19
I run it using cron on a Raspberry Pi Zero which just sits on my desk. Don't even have a monitor connected to it, just use ssh and vnc when necessary.
132
u/bl1ndside Sep 27 '19
I love the idea and execution. These silly projects make coding more fun and can make people excited about coding.
I made a twitter bot for my brother. He's a staunch Republican and I would grab Nancy Pelosi's tweets everyday and send them via text message to his phone.
20
11
3
2
2
2
-3
u/ready-ignite Sep 28 '19
That's wild. My brother is a staunch Democrat. After cat facts got old I started sending Nancy Pelosi's tweets by text message as a prank. Now he's a staunch Republican. He said he had no idea what politicians actually said, didn't follow the news much. Results may vary.
13
u/geoelectric Sep 28 '19
Seriously for a second, I think you’re an absolute hero.
You’ve demonstrated the brass ring incredibly clearly to a learning sub: these skills mean you can change the world from your keyboard with your brain. We now have something new (and pretty damned funny) that exists because you thought it’d be cool if it did and figured out how to translate that thought to code.
Taking this from what had to be one hell of a shower thought to an actual implementation and treating it seriously enough to have a repo, README, etc, is impressive work. Thanks so much for showing it to us.
21
u/Elite4alex Sep 27 '19
This is the kind of quality ridiculous content I come here to see
10
u/MonkeyNin Sep 27 '19
<eyes narrow>
That's exactly what a bot would say.
13
7
22
u/blabbities Redux FTW Sep 27 '19
Reading the title is hilarious. Reading how it works is funny. Good on you.
12
4
1
u/Alaska1429 Oct 02 '19
Just wondering, how did you put the posts on twitter? Is there a Twitter api or something?
1
6
2
2
2
2
2
u/cbat971 Sep 28 '19
I've been playing around with code to grab tweets by really cool Spanish accounts and texting them to me in an attempt to learn Spanish bit by bit every day.
2
u/Dr_Smeegee Sep 28 '19
I think I read a Charlie Stross novel about this script and some decerebrated kittens.
3
2
1
1
1
1
1
-24
0
Sep 27 '19
[deleted]
91
u/Flkdnt Sep 27 '19
Elaborate pranks and code, the internet was made for this.
18
u/szirith Sep 27 '19
Mission accomplished!
18
u/thecodingrecruiter Sep 28 '19
Close your terminals and shut your laptops. It's finally finished.
11
u/eitauisunity Sep 28 '19
I recall there being a Yahoo commercial in the late 90's that referenced reaching the last page of the internet. Lol.
0
Sep 28 '19
[deleted]
2
u/eitauisunity Sep 28 '19
I misremembered it being Yahoo. This was the commercial. So many nostalgic neurons fired. Thank you.
10
8
0
0
1
Oct 01 '19
[removed] — view removed comment
2
u/pattyperk Oct 01 '19
So I'm not necessarily determining the most famous person myself. I'm actually just grabbing the first celebrity element on the page using Beautiful Soup. So, the first entry on the page is automatically the most famous person (according to them). You can see how I'm doing this in the
get_celeb_name_and_image_from_famous_birthdays(url)function.I do download the images, and they're stored in a local folder and uploaded. This is necessary in order to upload the media to twitter.
I've been thinking about making a video for my next bot, so watch out for that. I watched this video when first starting out, and it helped me understand how to use tweepy and the authentication process.
1
0
Sep 28 '19
[deleted]
4
u/bmw2621 Sep 28 '19
If someone looks at the twitter account and lacks the intelligence to notice every tweet is formatted the same, then they have bigger problems than "spreading misinformation" on the interwebs.
If a post is retweeted and third party lacks the intelligence to check account before propagating retweet, your concerns for them also should be more along the lines of "oh no, you lack the basic intelligence needed for human survival, please don't get hurt, should I help you cross the street?" And so on...
0
Sep 28 '19
[deleted]
1
u/bmw2621 Sep 29 '19
So elderly have vested interest in 6ix9ine? Or care? En individual is responsible for what they believe and do not believe, and to research on there own.
Even our ”elderly" population has now grown up with TV and raised kids saying ”don't believe everything you see on tv".
6
u/jonaro00 Sep 27 '19
What did you use to execute the code once every day?