Twitter bot for Cex.io that tweets each hour the current price of GHS/BTC
- PHP (version 5 or better)
- cURL support/extension
- Download files
- Generate API key and API secret (https://cex.io/trade/profile)
- Sign in to http://twitter.com and register an application from the http://dev.twitter.com/apps page. NOTE Remember to never reveal your consumer secrets.
- Click on My Access Token link from the sidebar and retrieve your own access token. Now you have the consumer key, consumer secret, access token and access token secret.
- Once all files are in the same directory, you can run the script my launching Terminal and typing:
cd ~/path/to/directory/containing/files
php script.php
NOTE For this example, the script has been uploaded to a web server.
- Upload all files to your chosen web server.
- Create new cron job to run every hour with the following command:
/usr/bin/wget -O - -q "http://website.com/folder/script.php"
Two very helpful frameworks were required for this script to work properly. Those are Cex.io's php api and Matt Harris' tmhOAuth. They can be found at these locations:
http://github.com/matveyco/cex.io-api-php and http://github.com/themattharris/tmhOAuth