deadlykam / FunnyBot

A twitter bot that tweets in a given time intervals.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FunnyBot

Introduction

A twitter bot that tweets in a given time intervals.

Description

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.


Table of Contents:


Prerequisites

Netbeans

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.

Java

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.

Twitter4j

Latest stable Twitter4j version is twitter4j-4.0.7. Dowload twitter4j from here.


Installation

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.


Usage

Start the FunnyBot.jar in Funnybot/Funnybot/dist folder.

Default State

Figure: Default State

Set Credentials

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.

Opening Credential Menu

Figure1: Opening Credential Menu

Credential Menu

Figure2: Credential Menu

Credentials Successfully Setup

Figure3: Credentials Successfully Setup

Set Tweets

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.

Opening Tweets Menu

Figure4: Opening Tweets Menu

Tweets Menu

Figure5: Tweets Menu

Tweets Successfully Setup

Figure6: Tweets Successfully Setup

Set Timer

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

Best example:
Bot Setting -> tw > tc

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.

Good example:
Bot Setting -> 1 : 1

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.

Bad example:
Bot Setting -> tw < tc

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.

Opening Timer Menu

Figure7: Opening Timer Menu

Timer Menu

Figure8: Timer Menu

Timer Successfully Setup

Figure9: Timer Successfully Setup

Set Log Path (Optional)

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.

Opening Log Location

Figure10: Opening Log Location

Set Log Location

Figure11: Set Log Location

Select Log Location

Figure12: Select Log Location

Saving/Loading Your Setting

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.

Save File

Figure13: Save File

Select File Location

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.

Open File

Figure15: Save File

Select File

Figure16: Select File Location

Starting The Bot

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.

Bot Starting

Figure17: Bot Starting

Bot Started Successfully

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.

Bot Starting

Figure19: Bot Stopping

Bot Started Successfully

Figure20: Bot Stopped Successfully

Versioning

The project uses Semantic Versioning. Available versions can be seen in tags on this repository.

Credits

  • Twitter4j - Made it easy to use the twitter API.

Authors

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details

About

A twitter bot that tweets in a given time intervals.

License:GNU General Public License v3.0


Languages

Language:Java 100.0%