Twitter profile: https://twitter.com/CryptoBotDomin ** Account out of service due to hosting issues **
As I'm always looking for different investments and higher capital returns, I decided to build a Twitter bot capable of creating new tweets ifself everyday with crypto info.
BTC, ETH e SOL were chosen in the first place. Upcomming versions might have different options.
- Clone the following link locally
git clone https://github.com/DanielDomingueti/twitter-bot-bitcoin.git
cd twitter-bot-bitcoin
- Create a Twitter account
https://twitter.com/i/flow/signup
- Get your account KEY to create requests following the link below
https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api
- Create the file twitter4j.properties (src/main/resources) and insert the keys as following
oauth.consumerKey=API KEY from Twitter
oauth.consumerSecret=API KEY SECRET
oauth.accessToken=ACCESS TOKEN
oauth.accessTokenSecret=ACCESS TOKEN SECRET
-
Run the Spring application and the cron will be execute at a given moment.
-
You can also make a request in this URL if you're willing to create a tweet instantly.
POST http://localhost:8080/messari/post/
- But if you just want to fetch data, here you go
GET http://localhost:8080/messari/get/{cryptoSymbol e.g. BTC}
This project was built with these technologies:
- Spring Boot
- Java 11
- Maven
- Twitter4J library
- Messari API
- AWS EC2 for deployment
Brief explanation about the project's functionalities
-
Its core is based on a CRON method. Everyday at 10 a.m. and 22 p.m. the system make a request at
/messari/get/{cryptoSymbol}
and grab BTC, ETH and SOL's current price. -
The service
InsertTweetService
process it and call the function execute() inPostTweet class
to post a tweet. -
You can easily change the cron's time in
PostTweet
-
If needed, you can insert a tweet at the current moment at
/messari/post