readme

Download Readme

If you can't read please download the document

Upload: gustavolino

Post on 22-Dec-2015

14 views

Category:

Documents


2 download

DESCRIPTION

github

TRANSCRIPT

bot: gubbins-ng.pyauthor: birchy ([email protected])python version: 2.7.3 (STABLE default on Debian 7 Wheezy)-- PRE-REQUISITES --Betfair have increased security and you can no longer login from a bot using onlyyour username and password. You will now require an ssl certificate which islinked to your account. This will be sent along with your username and password.The api-ng library will handle this automatically as long as you have met thefollowing requirements.Before running this bot you MUST:1. Create ssl keys and put them in the betfair/ssl_keys folder. More info at:https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Non-Interactive+%28bot%29+loginIf the above url doesn't work, go to the api docs page and search for "Non-Interactive login"If you are a Linux user, I have written a tutorial here:http://diybetfairbots.lefora.com/topic/19400982/Debian-Linux-Creating-an-SSL-certificate-for-loginYou will have to join the forum to read it.NOTE: default cert names are prefixed 'client-2048'. To use the bespokebots API-NGlibrary, you must rename these files to your betfair account username,e.g. 'yourusername.crt' and 'yourusername.key'. This makes it easy to identifywhich account the certs are linked to, particularly if you have mulitiple betfairaccounts. See api_ng.py __init__() function for more info. The included bot alsoassumes this naming convention - see run() function, ssl_prefix for more info.2. Create an application key:https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Application+Keys3. Enter your account details in manager.py. HINT: APP_KEY should be your LIVEdata application key and NOT the delayed one.4. You will need to install the Python "http requests" library:http://docs.python-requests.org/en/latest/user/install/#installFor Linux users, this will require the following commands:$ wget https://bootstrap.pypa.io/get-pip.py$ sudo python get-pip.py$ sudo pip install requests-- RUNNING THE BOT ---The parent is manager.py and automates bot startup and error handling. It keepsthe bot running 24/7 and is intended for use on dedicated or VPS servers andsupports a "start it and forget it" ethic. You can also run the bot on your ownpc - it works in exactly the same way. There is a variable named EXIT_ON_ERRORwhich tells the bot whether to run forever (logging errors to err_log.txt) ORexit when an error occurs. This is currently set to True, so the bot will exitwhen an error occurs. Once you have the bot working how you want, you should setthis to False - the bot will then run 24/7 and log any errors to err_log.txt.If an error occurs,the bot will wait for 60 seconds and then restart automatically.HTTP errors are fairly common - this is not a fault within the bot and are due toBetfair's servers being unreachable/overloaded/slow responding/etc. Also, thenature of the internet means we can never guarantee 100% uptime as your ownconnection may occasionally suffer from lag, packet loss, disconnections, etc.Assuming you have Python 2.7.3 installed, created your ssl certificates, uploadedthem to your betfair account, copied the certs to the betfair/ssl_certs folder,created your application key and entered it into manager.py along with yourusername and password...you are ready to start botting!First, you need to get the full path to the manager.py file. On Linux, this willbe something like:"gubbins-ng/manager.py" (if you unzipped the download to your HOME folder)On Windows this may be:"C:\Users\burt\Desktop\gubbins-ng\manager.py" (if your Windows username is "burt"and you unzipped the download to your desktop)To run the bot in a command terminal, simply open a command prompt and enter:"python gubbins-ng/manager.py" (or whatever your file path is).You can also run the bot from your favourite Python editor/IDE if it has launchcapabilities. And on Windows, I believe double-clicking the manager.py file willalso launch the bot in a DOS terminal if you have Python installed correctly...although this is unverified as I do not have a Windows machine.Note that there is NO Graphical User Interface (GUI) with this bot as it is notintended for human interaction. If you need a GUI, you will have to write yourown. This api-ng library and test bot are just a building blockto get you started. The rest is up to you. ;o)GOOD LUCK!