ravenrebels / twitterbot

Twitter bot for Ravencoin blockchain
9 stars 3 forks source link

Ravencoin Twitter Bot

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

Getting started summary

Register as developer over at Twitter

Register as developer at https://developer.twitter.com/ \ It takes some time to be approved

Setup a Ravencoin full node

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

Node.js

You need to have Node.js https://nodejs.org/en/ installed

GIT CLONE

You need to have git installed

To download the code run\ git clone https://github.com/ravenrebels/twitterbot.git

Install code dependencies

In the "git cloned" directy, run\ npm install

Configure your project

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

Start the script, from the command prompt

node index