Now that Radiator supports transaction signing, I thought I'd combine it with the existing streaming capability. So this is a simple bot that mirrors other users and votes on the same things (posts and comments). It only upvotes if the original vote is an upvote. --- To use this [Radiator](https://steemit.com/steem/@inertia/radiator-steem-ruby-api-client) bot: ##### Linux ```bash $ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev $ gem install bundler $ bundle config git.allow_insecure true ``` ##### macOS ```bash $ gem install bundler ``` I've tested it on various versions of ruby. The oldest one I got it to work was: `ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-darwin14.4.0]` First, make a project folder: ```bash $ mkdir radiator $ cd radiator ``` Create a file named `Gemfile` containing: ```ruby source 'https://rubygems.org' gem 'radiator', github: 'inertia186/radiator' ``` Then run the command: ```bash $ bundle install ``` Create a file named `tail_voters.rb` containing: ```ruby require 'rubygems' require 'bundler/setup' Bundler.require wif = 'Your Posting Wif' voter = 'your-account' list = ['inertia', 'fyrstikken'] url = 'https://steemd.steemit.com' stream = Radiator::Stream.new(url: url) puts "Watching for votes by: #{list}" stream.operations do |operation| begin op_key = operation.keys.first op_value = operation.values.first print '.' next unless op_key == :vote next unless list.include? op_value.voter next unless op_value.weight > 0 author = op_value.author permlink = op_value.permlink puts "\nVoting on: #{author}/#{permlink}" tx = Radiator::Transaction.new(wif: wif, url: url) vote = { type: :vote, voter: voter, author: author, permlink: permlink, weight: 10000 } op = Radiator::Operation.new(vote) tx.operations << op tx.process(true) rescue => e puts e.inspect end end ``` Then run it: ```bash $ ruby tail_voters.rb ``` The above example would vote for anything `inertia` and `fyrstikken` vote for.  See my previous Ruby How To posts in: [#radiator](https://steemit.com/created/radiator) [#ruby](https://steemit.com/created/ruby)
author | inertia |
---|---|
permlink | how-to-write-a-vote-bot-in-ruby |
category | radiator |
json_metadata | {"tags":["radiator","ruby","steem","howto","curation"],"image":["http://www.steemimg.com/images/2016/08/24/1024px-Ruby_logo.svgdcc20.png"],"links":["https://steemit.com/steem/@inertia/radiator-steem-ruby-api-client","https://steemit.com/created/radiator","https://steemit.com/created/ruby"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-02-26 07:36:30 |
last_update | 2017-02-26 07:36:30 |
depth | 0 |
children | 2 |
last_payout | 2017-03-29 12:33:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 20.848 HBD |
curator_payout_value | 0.294 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,308 |
author_reputation | 346,568,901,399,561 |
root_title | "How to Write a Vote Bot in Ruby" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 2,595,809 |
net_rshares | 32,385,422,274,336 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anonymous | 0 | 368,661,132,080 | 75% | ||
berniesanders | 0 | 1,809,272,583,347 | 25% | ||
berkah | 0 | 108,156,989,577 | 100% | ||
hello | 0 | 122,751,734,680 | 75% | ||
world | 0 | 46,072,777,796 | 75% | ||
fufubar1 | 0 | 61,836,214,226 | 75% | ||
silver | 0 | 72,545,589,670 | 25% | ||
silversteem | 0 | 183,730,324,648 | 25% | ||
abit | 0 | 621,986,873,966 | 1% | ||
ihashfury | 0 | 60,525,194,727 | 55.2% | ||
nextgencrypto | 0 | 995,385,201,538 | 25% | ||
wang | 0 | 1,837,206,613,474 | 80% | ||
joseph | 0 | 614,006,066,809 | 100% | ||
masteryoda | 0 | 3,512,469,249 | 1% | ||
biodragon | 0 | 228,100,625,398 | 100% | ||
pairmike | 0 | 3,727,174,287 | 1% | ||
pheonike | 0 | 11,538,325,550 | 6% | ||
proctologic | 0 | 98,814,260,053 | 70% | ||
idol | 0 | 11,262,794,262 | 100% | ||
abcd | 0 | 116,786,736 | 1% | ||
steemrollin | 0 | 208,286,686,135 | 67.5% | ||
konelectric | 0 | 812,184,852 | 1% | ||
proctologic2 | 0 | 209,636,762 | 70% | ||
jocelyn | 0 | 128,872,613,883 | 100% | ||
proctologic3 | 0 | 546,418,823 | 70% | ||
jamtaylor | 0 | 66,608,319,104 | 100% | ||
leesunmoo | 0 | 737,277,607,586 | 100% | ||
forrestwillie | 0 | 646,603,762 | 1% | ||
teamsteem | 0 | 428,145,044,416 | 100% | ||
cryptoctopus | 0 | 1,405,797,806,693 | 100% | ||
error | 0 | 407,612,360 | 100% | ||
dragonslayer109 | 0 | 378,587,531,912 | 100% | ||
thecryptofiend | 0 | 264,498,490,018 | 100% | ||
justtryme90 | 0 | 101,890,408,769 | 40% | ||
applecrisp | 0 | 318,081,817 | 20% | ||
juanmiguelsalas | 0 | 33,309,904,239 | 100% | ||
andrei | 0 | 248,912,331 | 1% | ||
crok | 0 | 4,499,769,862 | 100% | ||
paul-gillbanks | 0 | 799,822,536 | 100% | ||
grey580 | 0 | 373,870,676 | 1% | ||
good-karma | 0 | 208,895,634,204 | 80% | ||
picokernel | 0 | 188,096,488,741 | 100% | ||
vi1son | 0 | 36,162,144,048 | 100% | ||
aurel | 0 | 409,322,573,977 | 40% | ||
jesta | 0 | 1,680,815,982,333 | 100% | ||
speda | 0 | 70,214,092,696 | 100% | ||
jamesjarman | 0 | 1,703,113,676 | 1% | ||
transisto | 0 | 10,862,427,877,404 | 100% | ||
mapipaz | 0 | 1,357,809,723 | 100% | ||
karenmckersie | 0 | 1,892,648,441 | 1% | ||
inertia | 0 | 227,940,355,712 | 100% | ||
rouketas | 0 | 50,010,236 | 100% | ||
fiveboringgames | 0 | 35,146,682,943 | 37.5% | ||
coininstant | 0 | 73,174,218,115 | 100% | ||
ubg | 0 | 587,513,939 | 1% | ||
bitcoiner | 0 | 43,941,954,197 | 100% | ||
bola | 0 | 11,372,302,560 | 40% | ||
celsius100 | 0 | 45,287,840,537 | 100% | ||
sokal | 0 | 2,659,009,642 | 100% | ||
seb | 0 | 1,143,807,433 | 100% | ||
raymonjohnstone | 0 | 9,610,350,921 | 100% | ||
mysteem | 0 | 2,162,668,471 | 80% | ||
sergey44 | 0 | 489,355,924 | 100% | ||
pump | 0 | 1,358,862,519 | 100% | ||
dirty.hera | 0 | 190,799,665 | 100% | ||
felixxx | 0 | 54,374,513,720 | 100% | ||
dez1337 | 0 | 9,076,988,338 | 100% | ||
transhuman | 0 | 11,314,699,080 | 100% | ||
toxichan | 0 | 162,291,084 | 1% | ||
timelapse | 0 | 462,667,622 | 1% | ||
achim86 | 0 | 21,410,466,891 | 100% | ||
tannukas6 | 0 | 63,576,844 | 1% | ||
randyclemens | 0 | 4,722,733,244 | 100% | ||
darthnava | 0 | 379,514,023 | 1% | ||
ioc | 0 | 1,030,123,166,621 | 100% | ||
virtualgrowth | 0 | 6,351,554,826 | 30% | ||
lamech-m | 0 | 4,938,737,746 | 100% | ||
ripplerm | 0 | 13,938,115,762 | 100% | ||
demo | 0 | 325,292,691 | 80% | ||
jsantana | 0 | 1,643,224,191 | 8% | ||
rjbauer85 | 0 | 237,486,203 | 40% | ||
jyp | 0 | 140,108,913,090 | 100% | ||
sethlinson | 0 | 4,034,390,550 | 20% | ||
hilarski | 0 | 54,931,377,657 | 20% | ||
naquoya | 0 | 63,908,037,520 | 75% | ||
runridefly | 0 | 9,255,176,714 | 25% | ||
barrydutton | 0 | 1,237,274,643 | 1% | ||
stephenkendal | 0 | 32,754,567,174 | 100% | ||
krnel | 0 | 864,288,006,733 | 100% | ||
penguinpablo | 0 | 159,215,217,248 | 100% | ||
steemitguide | 0 | 629,090,090 | 1% | ||
ivet | 0 | 15,456,656,604 | 51% | ||
richardcrill | 0 | 1,439,980,929 | 1% | ||
sponge-bob | 0 | 163,598,407,036 | 30% | ||
titusfrost | 0 | 39,155,163,771 | 100% | ||
doitvoluntarily | 0 | 152,860,924,334 | 100% | ||
thecyclist | 0 | 955,838,297,530 | 25% | ||
maarnio | 0 | 7,731,779,351 | 100% | ||
jacobts | 0 | 229,282,190 | 1% | ||
finleyexp | 0 | 638,501,393 | 80% | ||
jsg | 0 | 79,600,259,565 | 100% | ||
patelincho | 0 | 110,996,146 | 1% | ||
feruz | 0 | 321,945,819 | 80% | ||
bitcoinparadise | 0 | 26,545,321,960 | 100% | ||
whatsup | 0 | 37,821,732,315 | 100% | ||
bestofreddit | 0 | 2,714,124,290 | 67.5% | ||
kiwiscanfly | 0 | 17,259,189,169 | 100% | ||
thegame | 0 | 519,959,824 | 10% | ||
steembets | 0 | 528,033,339 | 10% | ||
dodders007 | 0 | 47,625,508,212 | 100% | ||
kiks14 | 0 | 156,944,427 | 100% | ||
gamer00 | 0 | 4,457,267,145 | 1% | ||
tomino | 0 | 200,186,351,298 | 100% | ||
steem-meme | 0 | 1,925,724,388 | 20% | ||
sunscape | 0 | 10,440,259,414 | 20% | ||
giantbear | 0 | 1,238,689,423 | 1% | ||
stray | 0 | 422,870,925 | 1% | ||
meanpeoplesuck | 0 | 139,733,556 | 100% | ||
lovethepeople | 0 | 95,042,573 | 70% | ||
daisyd | 0 | 255,674,181 | 1% | ||
vladtheimpaler | 0 | 1,690,992,803 | 100% | ||
steemland.com | 0 | 528,076,742 | 10% | ||
porco-bastardo | 0 | 92,354,860 | 70% | ||
angel76 | 0 | 15,697,960,663 | 100% | ||
sqube | 0 | 2,968,471,731 | 1% | ||
crowdfundedwhale | 0 | 36,880,611,392 | 60% | ||
trans-juanmi | 0 | 6,195,799,955 | 60% | ||
nigelmarkdias | 0 | 3,159,978,506 | 100% | ||
doodleman | 0 | 12,744,430,827 | 100% | ||
esteemapp | 0 | 334,228,985 | 80% | ||
steemprentice | 0 | 14,830,837,876 | 30% | ||
spbesner | 0 | 7,380,790,755 | 100% | ||
blackchen | 0 | 26,140,184,645 | 33.75% | ||
reisman | 0 | 1,698,025,060 | 80% | ||
engagement | 0 | 1,682,024,990,221 | 25% | ||
irawandedy | 0 | 1,277,819,593 | 100% | ||
seablue | 0 | 343,100,964 | 1% | ||
vcelier | 0 | 326,172,524,653 | 75% | ||
the-devil | 0 | 264,780,739 | 40% | ||
juliosalas | 0 | 1,001,038,733 | 60% | ||
meysam | 0 | 507,718,948 | 1% | ||
kyra-kristian | 0 | 88,620,304 | 100% | ||
jphenderson | 0 | 452,760,740 | 30% | ||
tamersameeh | 0 | 655,366,987 | 100% | ||
love-you | 0 | 53,746,286 | 100% | ||
stmdxrafi | 0 | 96,520,856 | 100% | ||
johnthehoan | 0 | 604,567,707 | 100% | ||
personz | 0 | 21,613,644,398 | 100% | ||
darth-azrael | 0 | 3,170,435,735 | 70% | ||
driptorchpress | 0 | 76,912,960 | 1% | ||
noagenda | 0 | 985,803,965,242 | 100% | ||
fisteganos | 0 | 3,631,594,851 | 40% | ||
thedeplorable1 | 0 | 527,311,596 | 1% | ||
bounties | 0 | 617,548,626 | 80% | ||
steempoll | 0 | 433,785,785 | 80% | ||
ogochukwu | 0 | 2,540,888,762 | 75% | ||
smalltalk | 0 | 199,600,622 | 37.5% | ||
tonylondon | 0 | 707,551,598 | 100% | ||
dzboston33 | 0 | 11,585,016,647 | 75% | ||
michaelnonso | 0 | 66,758,815 | 75% | ||
denmarkguy | 0 | 251,876,553 | 1% | ||
mestyz | 0 | 116,145,251 | 100% | ||
vegaiq | 0 | 55,764,185 | 100% | ||
humate | 0 | 8,029,327,299 | 100% | ||
filotasriza3 | 0 | 5,026,215,875 | 100% | ||
emeka | 0 | 75,648,904 | 75% | ||
rur | 0 | 325,721,286 | 75% | ||
ambyr00 | 0 | 76,374,244 | 30% | ||
kamidela | 0 | 51,025,493 | 100% |
Good job. Bots are evils ;)
author | abit |
---|---|
permlink | re-inertia-how-to-write-a-vote-bot-in-ruby-20170226t220937098z |
category | radiator |
json_metadata | {"tags":["radiator"],"app":"steemit/0.1"} |
created | 2017-02-26 22:10:15 |
last_update | 2017-02-26 22:10:15 |
depth | 1 |
children | 0 |
last_payout | 2017-03-29 12:33:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 27 |
author_reputation | 141,171,499,037,785 |
root_title | "How to Write a Vote Bot in Ruby" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,600,532 |
net_rshares | 22,102,692,262 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
personz | 0 | 22,102,692,262 | 100% |
Great to see more bot code open source 😆 If you'd like to contribute this to the [Steem FOSSbot project](https://github.com/steem-fossbot), let me know, I would love to make you a collaborator, or "repost" this myself as a repo. 🙂
author | personz |
---|---|
permlink | re-inertia-how-to-write-a-vote-bot-in-ruby-20170226t140932820z |
category | radiator |
json_metadata | {"tags":["radiator"],"links":["https://github.com/steem-fossbot"],"app":"steemit/0.1"} |
created | 2017-02-26 14:09:33 |
last_update | 2017-02-26 14:09:33 |
depth | 1 |
children | 0 |
last_payout | 2017-03-29 12:33:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 232 |
author_reputation | 42,452,361,038,560 |
root_title | "How to Write a Vote Bot in Ruby" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,597,473 |
net_rshares | 0 |