Elevator Pitch: This example uses the Twitter API to send Ravencoin assets/tokens to anyone who reply with their address.
Purely for educational purposes.
Brought to you by RavenRebels https://github.com/ravenrebels
Getting started video: https://www.youtube.com/watch?v=DZMrnjVQQzs
Register as developer at https://developer.twitter.com/ \ It takes some time to be approved
The node has to run in server mode, here is an example configuration
server=1
whitelist=127.0.0.1
rpcallowip=127.0.0.1
txindex=1
addressindex=1
assetindex=1
timestampindex=1
dbcache=2048
# Username for JSON-RPC connections
rpcuser=notsharingthatone
# Password for JSON-RPC connections
rpcpassword=notsharingthatone
You need to have Node.js https://nodejs.org/en/ installed
You need to have git installed
To download the code run\
git clone https://github.com/ravenrebels/twitterbot.git
In the "git cloned" directy, run\
npm install
Create a file called CONFIG.json.\ Example
{
"bearer": "FAKE_FAKE_AAAAAasdfasdfyMSAEAAAAABQasdfasdfeIasdfasdfDincauODaKCasdfasdffXkA3001KLcQUps02bAeasdfasdf4g",
"interval": 20,
"rpcUsername": "myVerySecretUsername",
"rpcPassword": "myMegaSecretPassword",
"rpcURL": "http://127.0.0.1:8766",
"RAVENCOIN_ASSET_NAME": "HOPIUM",
"scanMinutesBackInTime": 5,
"tweetId": "1111222233334444"
}
NOTE: we ask twitter every interval seconds to give us all the tweet/replies for the last scanMinutesBackInTime minutes. This affects your quota, performance cap over at Twitter. Twitter has a limit for about 500.000 reads per month. Try to keep scanMinutesBackInTime low.
Start the script, from the command prompt
node index