nerdfightersean / bitcointip Goto Github PK
View Code? Open in Web Editor NEWreddit bitcoin tipping bot
reddit bitcoin tipping bot
Reddit bitcointip bot This code is sometimes out of date and may not be compilable. At best it is a guide. This bot allows users to control bitcoins with their reddit account. Users can tip other users or bitcoin addresses within a reddit comment or message. The bot scans user comments and messages for tips of the form "+bitcointip @RedditUsername 1 BTC" and then sends the specified amount of bitcoins from the sender's bitcoin address, to the receiver's bitcoin address. Bitcointip Subreddit: http://www.reddit.com/r/bitcointip Full documentation can be found here: http://www.reddit.com/r/bitcointip/comments/13iykn/bitcointip_documentation/
convert private keys from what bitcoind gives to the wallet import format beginning with a '5'.
if btc is incoming, but has 0 confirmations, don't count it when figuring balance until it has 1 confirmation. But if btc is outgoing and has 0 confirmations, count it in the balance.
eval_comments() in /src/bitcointip.py
Use praw to fetch all new comments.
Go through newly fetched comments and use find_comment_command(commentdataarray) to see if the comment has any commands. Execution of the command is taken care of in the find_comment_command() function.
This way you can avoid the question of which subreddits are enabled or not.
If a user is quoting someone else's tip, it shouldn't do it.
specifically:
http://www.reddit.com/r/bitcointip/comments/132nhq/testing_area_b/c75emnf
http://www.reddit.com/r/bitcointip/comments/132nhq/testing_area_b/c75etqq
eval_messages() in /src/bitcointip.py
Use praw to fetch all new messages in /u/bitcointip inbox.
Go through newly fetched messages and use find_message_command(messageDataArray) to see if the message has any commands. Execution of the command and forming a response is taken care of in the find_message_command() function.
Includes Regex detection of currencies in a tip, managing exchange rates, as well has having the bot reply with a verification in the tipping currency and displaying amounts in PMs to a user in their set currency.
Right now it evaluates the newest 25, then the next newest 25 from newest to oldest each. Evaluate all comments and messages in the order that they were posted to avoid confusion.
edit submit_messages()
in /src/bitcointip.py
"replyto" is the comment's thing_id that needs replied to.
use praw to create the comment and reply:
sendresult = comment.reply(text)
and then mark comment as sent or not depending on sendresult.
compose a message using praw:
sendresult = reddit.compose_message(replyto, subject, test)
and then mark message as sent or not depending on sendresult.
If downtime is detected with bitcoind, mysql,or reddit, pause the service for a bit and try again later. if service is paused for too long, go into downtime mode. send notification to admin by accessing a notification url.
in +tip 100 usd, 100 is found as the amount and the reddit username.
in find_comment_command() and find_message_command(), regex is used to find out if a tip is present in the message. if there is, pass along the commentDataArray or messageDataArray to another function which evaluates the tip.
Take into account the differences in messages/comments.
http://en.wikipedia.org/wiki/Sql_injection
Such as src/bitcointip.py
Consider using prepared statements.
Make a withdraw command that accepts a bitcoin address and amount. Make this only available through PM to the bot.
Change the bot to update friends AFTER it has evaluated all the comments, not during.
In bitcoin or other currency amounts, don't display insignificant trailing 0s.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.