r/learnjava • • May 29 '21

Can you make a reddit bot in Java?

I've searched for tutorials online but all I get is videos of people creating a bot using Python. Can java create a bot just as easy as python?

65 Upvotes

18 comments sorted by

64

u/NautiHooker May 29 '21

This is done via Reddits API which can be used by any programming language that supports REST calls (which Java does).

13

u/ohnice_snub May 29 '21

Thanks! Noted!

23

u/[deleted] May 29 '21

Yes, you can. JRaw is the best java library for it. It makes it super simple. All you have to do is attach your private passcode and name as headers and you can get a response.

6

u/ohnice_snub May 29 '21

Thanks for the help!

9

u/[deleted] May 29 '21

Yes, if you Google for "reddit java api", you get some results (JRAW being the one that looks best to me), so it's at least possible to do so. It's more a question of how stable/up-to-date these other APIs are.

3

u/ohnice_snub May 29 '21

Thanks! Will do!

1

u/nutrecht May 31 '21

You can yes. But please don't make a dumb bot that actually posts to a lot of actual subreddits. They are obnoxious and you're very likely to make a mistake making them even more harmful.