/r/redditscripting

Photograph via snooOG

Share useful resources, interesting links, and cross-posts about Reddit scripts -- programming bots, tools, and writing programs that interact (directly or indirectly, through something like PRAW or GRAW) with the official Reddit API. All languages welcome, but I mostly use Python, and coders of all skill levels are welcome to come here and share their code.

This is a community for people who love to build scripts and bots for Reddit. Coders, remember to make sure your bots follow the proper botiquette.

Post a link to your website/GitHub/PasteBin/wherever if you want to share your work, post a link to another sub/useful internet resource if you know of one, or ask a question to get the conversation rolling!


Don't forget to choose your flair in the top right! Flair in this sub shows up like a profile picture.


Related subs:

/r/redditdev - for questions and PRAW support

/r/RequestABot - for getting ideas

/r/learnpython - for language help

/r/botwatch - all around bot-related sub

/r/Automate - general automation news/ideas

/r/redditscripting

403 Subscribers

0

image/video doxxing, NSFW, BotTerminator, online war, rabble rousing, text heavy

0 Comments
2023/04/29
00:35 UTC

2

A Script to Allow a User to Subscribe to Multiple Subreddits from a List

I am looking for a script or bot to allow a user to subscribe to multiple subreddits from a list. I have an account subscribed to roughly 3000 subreddits and I would like to make an alternate account that has the same subscriptions. I searched this subreddit for any previous requests and nothing seemed to match my requirement.

0 Comments
2022/07/09
20:14 UTC

1

Is someone stealing MONEY from my Shopify Store Website?

I hired an overseas developer to manage my online store. Everything was going just fine for about 3 months when all of a sudden I notice that all of my sales have been reduced by a few dollars. I ask him about the issue and he seems to act like he can't figure out why this is happening. I just wanted to ask someone in this forum if this SCRIPT that he installed in my stores' order status/ Checkout page has anything to do with the missing funds. Thank you in advance for your time and effort in helping me with this matter.

---- SCRIPT IN QUESTION----

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N3CSXC9');</script>
<!-- End Google Tag Manager -->
{% if first_time_accessed %}
<script>                               
window.dataLayer = window.dataLayer || [];                                            
var shipping_price = '{{shipping_price | money_without_currency }}';
shipping_price  = shipping_price.replace(",", ".");
var total_price = '{{total_price | money_without_currency }}';
total_price  = total_price.replace(",", ".");
var tax_price = '{{tax_price | money_without_currency }}';
tax_price  = tax_price.replace(",", ".");
window.dataLayer.push({
'page_type': 'purchase',
'event': 'analyzify_purchase',
'currency': "{{ shop.currency }}",
'totalValue': total_price,
'shipping': shipping_price,
'tax': tax_price,
'payment_type': '{{order.transactions[0].gateway}}',
'transaction_id': "{{order.name}}",
});
</script> 
{% endif %}
1 Comment
2021/07/29
07:22 UTC

0

Need help with an easy script

Hello guys! I was wondering if you can help me with this little script.

I have 107 directories in my directory /html In each one of those 107 directories I have a file named h.html Can you guys help me making a script that will enter into each directory, and change h.html into DIRECTORYNAME.html

Thanks a lot :D

3 Comments
2020/07/31
03:17 UTC

2

I want a bot thingy?

I would like a bot of my own and if anyone could give me the code for a simple one (i.e. If find x word, post x reply) I would appreciate it. Or if you could point me in the direction of how to make or get one I would appreciate it!

4 Comments
2018/12/28
06:42 UTC

2

I've created a dev tracker.

I've created a dev tracker on Reddit. The deployment is easy and can be done in under 5 minutes.
GitHub repo: https://github.com/NNTin/dev-tracker-reddit
Deployment on Heroku: https://www.youtube.com/watch?v=03nSVgs6GXw

The project is licensed under the MIT License. You can modify the code as you see fit.

Idea was inspired by: /r/fortnite/user/homebasebot/comments/
Example comment: /r/FORTnITE/comments/91mlo1/birthday_llama_hotfix/e2z5i50/

There is also: /r/fortnitebr/user/BattleBusBot/comments/

Both accounts are 10 days old.

Their code hasn't been released yet. So I wrote this myself. The idea of this bot is not novel. Today I discoered that /r/2007scape already has: /r/2007scape/user/JMOD_Bloodhound (3 months old, GitHub repo: https://github.com/Floogen/JMOD_Bloodhound written in powershell)

My bot is written in Python with a very easy Heroku deployment process. You can customize the intro message but you are also free to modify the outtro message by touching the code directly.

It's a bot that highlights comments of certain people in a separate comment. It has the entire quote as well as a link to the comment. In /r/fortnite and /r/fortnitebr it is a great addition. In /r/2007scape it is also nice because Jagex moderators have a tendency to say things that go against the community. That way the community has an easy way of finding dev posts.

Sadly I haven't found a subreddit to run my bot in yet. If you are aware of any community this bot might fit in please make a suggestion. However since I am not so involved with the community I will need a list of reddit names of the important community figures.

0 Comments
2018/07/26
21:32 UTC

1

Is it possible to have a bot take reddit comments in a specific thread and save them into a spreadsheet?

1 Comment
2018/05/09
02:04 UTC

1

Is there bot support for reporting?

We have a bot for a sub that tests the amount of truly black pixels in an image. Is there a way to have the bot automatically reported a submission if below say a 35% true black threshold?

2 Comments
2018/04/15
20:00 UTC

2

[Request] Writing a script/bot to save images from reddit automatically into different folders

I've been looking for a bot/script that helps me solve a very particular problem but I dont know where to start. Here's what I want to do:

Let's say I've saved a bunch of photos on my reddit profile. I want a bot/script to sort them out and save them automatically, each one to a different folder on my PC according to their name (the folder's name and post's name must match).

Example: On my HDD, in a specific location I've got a bunch of folders like:

  • C:\Saved\Drawings\Comics
  • C:\Saved\Drawings\Web
  • C:\Saved\Pics\Nature
  • C:\Saved\Pics\Space

If a post is called "Comics", the script/bot searches C:\Saved for a folder called "Comics" and saves the picture there. Is it possible to create a script using reddit's API that's capable of doing this? Can anyone point me into the right direction? Thanks!

7 Comments
2018/04/03
18:27 UTC

2

[QUESTION] Is there a way to put a real-time word cloud in a sub's side-bar?

I've done a search in this sub, but have only found this post from last year. I think it might be the start of a solution but I'm looking for a specific end result.

What I'd like to do is have a word cloud in a subreddit sidebar that's genned real-time from the sub's content for the previous, say, 6 months or a year.

The cloud would be genned from post titles and maybe the post content as well. Comments would not be analyzed, just the OPs.

Is there anything like this already out there? Thanks

9 Comments
2018/01/27
15:32 UTC

1

Welcome to /r/redditscripting!

Please post your bots with a brief description of what they do, and what you plan to do with it next. This sub has died down quite a bit but I still check all the submissions once every few weeks. I’ll review your bot whenever I get to it!

0 Comments
2017/12/05
17:21 UTC

4

Can I have some feedback on this bot I made?

Just made a bot that looks through a specific subreddit (always the one where it is called via. comment) and looks for reposts. It looks for reposts by comparing titles, links, and the content of a submission's body.

Do you think this bot would be useful? Are there any tweaks that I could make to make this bot more useful?

Future Plans

My bot currently isn't able to compare image from linked posts. In the future I hope the bot would be able to look at the image of the post of where it is called and find the exact submission where the image was posted already, even though the image might be reposted via. a separate link.

I'm not exactly sure how to do that yet but I know it's something that I'll need to add. It'll probably have to be done using karma decay but I'm not exactly sure. Any help on this would be nice, too.

What now?

What subreddits are bot friendly? Right now I only run the bot in r/test because I don't want to get banned. I plan on expanding to more in the future but I'll ask for permission first as to not get banned.

Thanks for any help.

1 Comment
2017/11/13
12:50 UTC

1

[Request] A bot that plays rocket league

I would like to have a bot that is capable of playing rocket league. This would include chasing the ball around... not just joining into a game a driving in a straight line. I would be willing to pay for such a bot so pm me if youre interested.

3 Comments
2017/10/12
13:03 UTC

4

Twitter Transcriber Bot

I know this has already been done before (and I'm pretty sure RES already does it automatically if you expand a twitter link), but I figured I would try to see if I could do it myself.

I used Python with the praw and tweepy modules to do this.

The bot in action once I got it working properly

I'm still new to APIs so I was pretty proud of this one!

2 Comments
2017/06/30
17:53 UTC

2

I've just created a bot that makes mobile banning easy! One word command, highly customizable, able to clear the user's entire history, and more! Come check it out!

4 Comments
2017/06/14
16:40 UTC

3

Baby's First Bot- The IT Crowd. Fairly proud of this.

I thought I'd try my hand at making a bot that responds with the follow-up to an IT Crowd reference. It responds to "Did you see that ludicrous display last night?" and "What was Wenger thinking, sending Walcott on that early?".

What do you think?

4 Comments
2017/06/02
19:44 UTC

2

/u/ggggnut makes a graph of creation and removal times of posts in MarchAgainstTrump

1 Comment
2017/05/22
03:48 UTC

10

Just dropped in here on a desktop, and, honestly, looking at the vertical space and the layout...

...Why the hell isn't all of Reddit like this? Because oh my good this is so much better

11 Comments
2017/04/25
16:25 UTC

8

There are 9 subreddits with a negative amount of subscribers

2 Comments
2017/04/14
14:40 UTC

Back To Top