https://github.com/michidk/simpletwitterbotapi
A very simple API/Twitter4J wrapper for Twitter bots.
https://github.com/michidk/simpletwitterbotapi
api bot twitter twitter-api twitter-bot twitter-client twitter4j twitterbot twitterbots
Last synced: 3 months ago
JSON representation
A very simple API/Twitter4J wrapper for Twitter bots.
- Host: GitHub
- URL: https://github.com/michidk/simpletwitterbotapi
- Owner: michidk
- License: mit
- Created: 2017-06-15T08:42:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T10:53:34.000Z (about 1 year ago)
- Last Synced: 2025-02-28T16:11:29.160Z (3 months ago)
- Topics: api, bot, twitter, twitter-api, twitter-bot, twitter-client, twitter4j, twitterbot, twitterbots
- Language: Java
- Homepage: https://twitter.com/miichidk
- Size: 30.3 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleTwitterBotAPI
A very simple API/Twitter4J wrapper for Twitter bots.## Example
```java
TwitterBot bot = new TwitterBot(); // create a new Twitter bot instanceBehaviour behaviour = BehaviourBuilder.create()
.listen(
new KeywordEvent("lookingForThisKeyword"), // looking for "lookingForThisKeyword" and "#mySuperCoolHashtag" on Twitter
new HashtagEvent("mySuperCoolHashtag") // can also be achieved by calling listen() on the builder multiple times
).filter(
new RTFilter() // exclude tweets that starts with "RT, a lot of bots do this
).react(
new QueuedReplyReaction("Test!", "Test 123")
).build();bot.addBehaviour(behaviour); // add the behaviour to the bot instance
// or do everything in one statement
bot.addBehaviour(
BehaviourBuilder.create().listen(
new MentionEvent("miichidk")
).react(
new LikeReaction()
).build()
);// ... add as many behaviours as you want
bot.start();
```## Setup
To create a new bot/bot behaviour just orientate on the example code.
Authentication works via Twitter4j. Follow the instructions [here](http://twitter4j.org/en/configuration.html). To authenticate via ConfigurationBuilder, just pass the built configuration object to the constructor of TwitterBot().## Dependencies
- Java 8
- [Guava](https://github.com/google/guava)
- [Twitter4j](http://twitter4j.org/)