A twitter bot that tweets in a given time intervals.
A twitter that tweets in a given time intervals. Tweeting a starting message and an ending message. Also tweeting in a given time interval, example tweeting after every 1 hour. I made this twitter bot as a hobby and to see how to use a bot in twitter. I will not be responsible for how you use this software. Please follow twitter policy for using this software, more information can be found in twitter developer page.
Latest stable Netbeans version is NetBeans IDE 8.2 (Build 201609300101) NetBeans IDE is updated to version NetBeans 8.2 Patch 2. Install the stable's version Netbeans from their older version listing. Or you could download the latest version of the Netbeans but that may cause problems.
Latest stable Java version is 1.8.0_144; Java HotSpot(TM) 64-Bit Server VM 25.144-b01 and Runtime version is Java(TM) SE Runtime Environment 1.8.0_144-b01. Download latest version of Java.
Latest stable Twitter4j version is twitter4j-4.0.7. Dowload twitter4j from here.
After following the Prerequisites, download the latest stable in Netbeans. If you want to just use the software then just Go to Funnybot/Funnybot/dist and open the FunnyBot.jar. If you want to make modifications then open the project in Netbeans and code away.
Start the FunnyBot.jar in Funnybot/Funnybot/dist folder.
Figure: Default State
After starting the software you will need to provide your twitter developer's consumer key, consumer secret, access token and access token secret. You can find your twitter credentials in your twitter developer's page. In the FunnyBot software open the credentials settings from Edit/Credentials menu. Here write down the consumer key, consumer secret, access token and access token secret. After giving the credentials press the Set button and close the Credential Setting. In the main menu the credential red light will turn green indicating that credentials have been given.
Figure1: Opening Credential Menu
Figure2: Credential Menu
Figure3: Credentials Successfully Setup
Next you need to set the tweets that you want the bot to send. Open the tweet menu from Edit/Tweets. In the tweet menu give the Start Message and End Message tweets. Then type the tweet in Enter Tweet box. once you are satisfied with the tweet then press the Add Tweet button to add the tweet to the bot tweet listing. If you want you can add as much tweet as you want. All the tweets add will be shown on the table below. Once you are done add the tweets press the Set button and close the menu. In the main menu the tweets red light will turn green indicating that tweets have been given.
Figure4: Opening Tweets Menu
Figure5: Tweets Menu
Figure6: Tweets Successfully Setup
Now you need to set the time cycle for your tweets. The time cycle will determine after how long will the bot send a tweet. You must make sure you have enough tweets that can be sent in a day, if not then the bot won't send any more tweets and will be waiting for the next day for refreshing the tweets. tw = tweet, tc = time cycle
If you set more than 24 tweets and give time cycle to 1 hour then the tweet posting rate will be 1 tweet per hour which means some of the tweets will be tweeted with in 24 hours in random order. After 24 hours the tweets will refresh meaning the bot will have all the tweets back again. This ensures a little bit of uniqueness to the bot because it have lot of tweets to choose from in a day and reduces repetition of the tweets.
If you set 24 tweets and give time cycle to 1 hour then the tweet posting rate will be 1 tweet per hour which means all tweets will be tweeted with in 24 hours in random order. After 24 hours the tweets will refresh meaning the bot will have tweets to tweet again. This will not make the bot look unique because it will be repeating the tweets again.
If you set less than 24 tweets and give time cycle to 1 hour then the tweeting posting rate will be 1 tweet per hour which means the bot will not have enough tweets to tweet with in 24 hours. When this happens the bot will wait for the tweets to be refreshed after 24 hours so that it can use the tweets again. This will not make the bot look unique because it will be repeating the tweets again.
After understanding how the tweet/time cycle works now you need to set the time cycle. Open timer menu from Edit/Set Timer. Give the the time cycle here and press the Set button. In the main menu the timer red light will turn green indicating that timer have been given.
Figure7: Opening Timer Menu
Figure8: Timer Menu
Figure9: Timer Successfully Setup
This part is optional. The default path on the log files is in the System's document location and the files are called Fail.txt and Success.txt. Fail.txt contains all the events that have been failed and Success.txt contains all the events that were successful. You can also open the file location from the software from File/Open Log, this will open a folder where these files are located.
If you want you can change the Log path, to do so you need to open Edit/Log Path and choose the folder destination for the Log path and press the Open button.
Figure10: Opening Log Location
Figure11: Set Log Location
Figure12: Select Log Location
Once you are happy with your settings you can save them and use them again in the future without following all the above steps again. To save your settings go to File/Save, choose a destination and a name and then press the Save button. This will save your settings.
Figure13: Save File
Figure14: Select File Location
To load your settings go to File/Open, go to the destination you have saved your file, select the .funnybot file and press the Open button. This will load all of the settings/information that you gave previously.
Figure15: Save File
Figure16: Select File Location
Once you have followed all of the above steps then now finally is the time to start the bot. To start the bot go to Bot/Start. This will turn the Start light from red to green, indicating that the bot has started. All the tweets that have been tweeted can be seen in the table in the main menu. This table will also show if there are any errors for example if the credentials given are wrong. The bot will now tweet in the given intervals and will only stop when you stop the bot.
Figure17: Bot Starting
Figure18: Bot Started Successfully
To stop the bot go to Bot/Stop. This will stop the bot from tweeting. The Start light will turn red from green, indicating that the bot has been turned off.
Figure19: Bot Stopping
Figure20: Bot Stopped Successfully
The project uses Semantic Versioning. Available versions can be seen in tags on this repository.
- Twitter4j - Made it easy to use the twitter API.
- Syed Shaiyan Kamran Waliullah - DeadlyKam
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details