reddit-bot | Java Reddit bot project | Bot library
kandi X-RAY | reddit-bot Summary
kandi X-RAY | reddit-bot Summary
It is a reddit-wide bot that parses comments and checks if they have Twitter link in them. If a comment contains a link then bot checks if user already submitted body of a tweet within comment and if not it posts value of a tweet as a child response. It is written entirely in Java. I started writing it in python but I do not know this language very well (if at all), so with great support for Java on RPi and after reading this blog: I decided to pick that language. I wanted it to be as modular and generic so I can reuse the main frame of the appliation if I wanted to create another bot. I run into some difficulites, mostly caused by reddit and twitter api, their respective limitations and what not. Also JRAW introduced two major bugs to my application and they were rather hard to debug and solve. It is run on Raspberry PI, but can be run on any machine. I have automated deploying process for linux system.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calls the constructor
- Look up a property by key
- Gets the OkHttpClient
- Gets a custom object mapper
- Entry point for the bot
- Fetches the most recent comments from the chat
- Get the matching comments from a list of comments
- Runs the poller
- Gets newest comments from a subreddit
- Get authorization URL
- Build an access token request
- Performs the authentication
- Reply to a comment
- Returns a URL for the given host and path
- Process post comment
- Re - upload an image
- Get an HttpURLConnection
- Reads the response from the URLConnection and returns the response
- Open a Properties file
- Returns the hashCode of the comment id
- Validates that the given string is not empty
- Gets the twitter status IDs from a comment
- Compares this object for equality
- Compares this object with the specified object
- Show a single tweet
- Returns true if the comment matches the regex
reddit-bot Key Features
reddit-bot Examples and Code Snippets
Community Discussions
Trending Discussions on reddit-bot
QUESTION
I have Python27 installed in Windows 7
I am trying to build a reddit bot using this tutorial
I found instructions on how to install pip for windows from here
The page says that after installing pip, I can use pip freeze to check if the installation went correctly
It says pip freeze should display some information as shown below
Microsoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation. All rights reserved.
C:\Users\Username>cd c:\Python27\Scripts
c:\Python27\Scripts>pip freeze
antiorm==1.1.1
enum34==1.0
requests==2.3.0 virtualenv==1.11.6
However pip freeze doesn't show me anything at all
Did pip install correctly, or is there any problem? Is there any other way i can test proper installation?
...ANSWER
Answered 2017-Jun-04 at 06:57If you want to test it thoroughly, you can use your actual pip installation to install something. For example, numpy would be a good sized example that can rule many problems out.
> pip install numpy
Now, run pip freeze
again to check if pip is working as expected. It should then have something to show.
If you want to test it even further, you can open a terminal and
QUESTION
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 the script, because 'others might see them'.
Now, you need to update your praw ini file to remember these settings. Otherwise, you’ll have to put them in your script and thats dangerous (as others might see them).
Does my script get uploaded to Reddit, where it can then be read by other people? If not, why is it then unsafe?
...ANSWER
Answered 2018-Aug-23 at 18:20If you're only developing this bot as a proof of concept and always running it from the computer that you're developing it on there is little risk that your credentials will be leaked. However most code doesn't live it's life as only one copy on only one system. The vast majority of modern software development best practices are based around the assumption that different computers will develop the code, store versions of the code and actually run the code.
If you hard code your login credentials in your login script and are only running it from your computer this isn't going to be an issue. What if you need help debugging your bot? What if you're really proud of it and want to show it off? What if you want to store a backup on another system? What if you don't want to have it running on the same computer you developed it on? Suddenly code containing your login credentials are getting shared across multiple computers. The more systems your code is on the easier it will be for someone to get access to them. This is why it's a software development best practice to not hard code secrets, like login credentials, in scripts, or code.
In the case of the tutorial you're following they're instructing you to run your code on a VM and use git for source control. As soon as you commit your credentials into git they will always be a part of that repositories git history. If you ever host your repos on a remote system such as GitHub your credentials will be stored on a system outside your control.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reddit-bot
You can use reddit-bot like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the reddit-bot component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page