Dear Steemians, since the upvote bot was not received well, I'd like to present another way of using the piston library for bots: **A @-notification bot** in 30 lines of code ``` from piston.steem import Steem import os import json import sendgrid steem = Steem() sg = sendgrid.SendGridClient( os.environ['SENDGRID_USERNAME'], os.environ['SENDGRID_PASSWORD'] ) message = sendgrid.Mail() addresses = {"xeroc": "mail@xeroc.org"} # addresses = os.environ["ADDRESSES"] for c in steem.stream_comments(start=1898900): for user in addresses.keys(): if "@%s" % user in c["body"]: message.add_to(addresses[user]) message.set_subject('Notification on Steem') message.set_text( "You have been messaged by %s " % (c["author"]) + "in the post @%s/%s" % (c["author"], c["permlink"]) + "\n\n" + "You can read the post on Steemit.com:\n" + "http://steemit.com/%s/%s#@%s/%s" % (c["category"], c["openingPostIdentifier"], c["author"], c["permlink"]) ) message.set_from('notify@steem') status, msg = sg.send(message) print("\nMessage sent!\n") ``` ### Note This currently requries that you install the python-steem library as well as piston from the development branch. Have fun!
author | xeroc |
---|---|
permlink | notification-bot-for-steem-in-30-lines-of-code |
category | steem |
json_metadata | "" |
created | 2016-05-30 11:46:15 |
last_update | 2016-05-30 11:46:15 |
depth | 0 |
children | 15 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 160.447 HBD |
curator_payout_value | 160.401 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,416 |
author_reputation | 118,819,064,085,695 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,575 |
net_rshares | 61,442,989,614,459 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
barrie | 0 | 0 | 100% | ||
summon | 0 | 14,392,803,284,050 | 100% | ||
fattire | 0 | 154,802,758,200 | 100% | ||
enable | 0 | 553,254,374,400 | 100% | ||
freedom | 0 | 5,633,243,438,578 | 100% | ||
wackou | 0 | 4,394,073,719,343 | 100% | ||
badassmother | 0 | 3,240,702,535,673 | 100% | ||
xeldal | 0 | 2,746,697,055,417 | 100% | ||
samupaha | 0 | 1,324,545,842,984 | 100% | ||
hr1 | 0 | 2,312,929,529,400 | 100% | ||
fuzzyvest | 0 | 4,230,964,569,874 | 100% | ||
silversteem | 0 | 2,261,779,567,410 | 100% | ||
ihashfury | 0 | 924,296,152,470 | 100% | ||
liondani | 0 | 539,693,023,320 | 100% | ||
steemit200 | 0 | 7,223,066,217,585 | 100% | ||
xeroc | 0 | 884,917,544,305 | 100% | ||
complexring | 0 | 2,967,085,899,550 | 100% | ||
arhag | 0 | 2,591,074,174,849 | 100% | ||
joseph | 0 | 695,364,011,407 | 100% | ||
bhuz | 0 | 858,073,316,259 | 100% | ||
au1nethyb1 | 0 | 2,882,322,082,700 | 100% | ||
mineralwasser | 0 | 0 | 100% | ||
boombastic | 0 | 0 | 100% | ||
mrs.agsexplorer | 0 | 0 | 100% | ||
bingo-0 | 0 | 0 | 100% | ||
bingo-1 | 0 | 0 | 100% | ||
cass | 0 | 19,199,260,000 | 100% | ||
idol | 0 | 8,045,561,222 | 100% | ||
tuck-fheman | 0 | 128,806,191,564 | 100% | ||
donkeypong | 0 | 147,163,821,475 | 100% | ||
steemrollin | 0 | 1,164,484,076 | 100% | ||
alexgr | 0 | 429,610,196 | 100% | ||
void | 0 | 587,559,385 | 100% | ||
pstrident | 0 | 917,009,105 | 100% | ||
nenad-ristic | 0 | 562,273,735 | 100% | ||
sandwich | 0 | 13,593,232,577 | 100% | ||
juanlibertad | 0 | 12,214,647,203 | 100% | ||
vato | 0 | 133,171,597,646 | 100% | ||
dana-edwards | 0 | 533,503,319 | 100% | ||
cryptorune | 0 | 507,460,908 | 100% | ||
idealist | 0 | 53,975,012,907 | 100% | ||
spaninv | 0 | 4,037,842,108 | 100% | ||
madmekmazgruk | 0 | 462,226,277 | 100% | ||
bbqbear | 0 | 2,089,005,226 | 100% | ||
pal | 0 | 49,104,766,520 | 100% | ||
jerome-colley | 0 | 324,697,521 | 100% | ||
john-kimmel | 0 | 6,585,779,431 | 100% | ||
hossary | 0 | 14,284,555,650 | 100% | ||
limitless | 0 | 905,996,503 | 100% | ||
kefkius | 0 | 433,490,718 | 100% | ||
jonde | 0 | 430,874,199 | 100% | ||
xav | 0 | 4,239,508,583 | 100% | ||
amartinezque | 0 | 421,257,221 | 100% | ||
censor-this | 0 | 426,483,895 | 100% | ||
are-you-mad | 0 | 426,427,249 | 100% | ||
murh | 0 | 0 | 33.01% | ||
martinallien | 0 | 417,707,125 | 100% | ||
b4bb4r-5h3r | 0 | 299,651,631 | 100% | ||
djleo | 0 | 1,959,197,586 | 0% | ||
dalinofx | 0 | 284,007,109 | 100% | ||
computer256 | 0 | 23,197,458,512 | 100% | ||
meouw | 0 | 98,358,303 | 100% | ||
idealsceneprod | 0 | 0 | 100% |
Python-steem library? I can work with that! Although I don't know yet the possibilities of the library. I want to know if data can be passed between Steem and another platform such as an Ethereum smart contract?
author | dana-edwards |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t115555872z |
category | steem |
json_metadata | {} |
created | 2016-05-30 11:55:54 |
last_update | 2016-05-30 11:56:33 |
depth | 1 |
children | 6 |
last_payout | 2016-08-20 17:26:51 |
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 | 212 |
author_reputation | 353,623,611,191,427 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,585 |
net_rshares | 0 |
Of course you can make a link layer. You would need the etherium library as well to do that. But making something that will take all @ mentions and put them through an etherium contract would definitely be doable. That's the beauty of blockchain, everything is open.
author | censor-this |
---|---|
permlink | re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t123928961z |
category | steem |
json_metadata | {} |
created | 2016-05-30 12:39:30 |
last_update | 2016-05-30 12:39:30 |
depth | 2 |
children | 1 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 17.468 HBD |
curator_payout_value | 17.468 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 266 |
author_reputation | 1,720,978,822,824 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,625 |
net_rshares | 19,008,895,905,443 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
dantheman | 0 | 19,008,351,732,057 | 100% | ||
dana-edwards | 0 | 544,173,386 | 100% |
In that case I have some interesting ideas. I have some ideas to redefine social media by blending intelligent agents with some mechanism to communicate from one blockchain to the next. I like Steem because if the right API is provided we could really do interesting things with intelligent agents (bots).
author | dana-edwards |
---|---|
permlink | re-censor-this-re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t180845662z |
category | steem |
json_metadata | {} |
created | 2016-05-30 18:08:45 |
last_update | 2016-05-30 18:08:45 |
depth | 3 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.022 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 305 |
author_reputation | 353,623,611,191,427 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,863 |
net_rshares | 13,593,232,577 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
sandwich | 0 | 13,593,232,577 | 100% |
http://ethereum.stackexchange.com/questions/2/how-can-an-ethereum-contract-get-data-from-a-website This is what you're looking for to make etherium contracts pull data. There are a few options in this post. I'm no expert so I won't try to summarize. If you're not worried about "centralization" than it would be easier and cheaper to run a program that links locally or on a server.
author | censor-this |
---|---|
permlink | re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t131449789z |
category | steem |
json_metadata | {} |
created | 2016-05-30 13:14:51 |
last_update | 2016-05-30 13:17:00 |
depth | 2 |
children | 1 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.022 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 383 |
author_reputation | 1,720,978,822,824 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,649 |
net_rshares | 14,135,710,567 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
sandwich | 0 | 13,291,160,742 | 100% | ||
censor-this | 0 | 426,483,895 | 100% | ||
are-you-mad | 0 | 418,065,930 | 100% |
Yes this answers part of it. It can get data into an Ethereum smart contract if the data feed is public. It's not ideal because it's probably not good enough to build some form of communication mechanism beyond a data feed but it's a start. I could work with that.
author | dana-edwards |
---|---|
permlink | re-censor-this-re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t181342409z |
category | steem |
json_metadata | {} |
created | 2016-05-30 18:13:42 |
last_update | 2016-05-30 18:13:42 |
depth | 3 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
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 | 264 |
author_reputation | 353,623,611,191,427 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,865 |
net_rshares | 0 |
You can get data out of Steem and put it into Ethereum. The procedure would be centralize though. What do you have in mind?
author | xeroc |
---|---|
permlink | re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t124035183z |
category | steem |
json_metadata | {} |
created | 2016-05-30 12:40:33 |
last_update | 2016-05-30 12:40:33 |
depth | 2 |
children | 1 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.168 HBD |
curator_payout_value | 0.168 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 124 |
author_reputation | 118,819,064,085,695 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,626 |
net_rshares | 867,219,193,419 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xeroc | 0 | 867,219,193,419 | 100% |
I would like it to be easy to build intelligent agents which can communicate from (A) -> (B) -> (C) etc where each is a different blockchain and or smart contract. Basically I feel like Steem is somehow an island and without the ability to communicate off the island we miss out on a lot of apps and potential powers. Like imagine what could be done with intelligent agents on Steem which can interface with smart contracts on Ethereum, or any other platform? I understand it will not be easy but I know with side chains you can possibly build a cross chain gateway. A notification bot or voting bot is nice but if that bot could interact with Ethereum smart contracts for example then it's much nicer.
author | dana-edwards |
---|---|
permlink | re-xeroc-re-dana-edwards-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t181147432z |
category | steem |
json_metadata | {} |
created | 2016-05-30 18:11:48 |
last_update | 2016-05-30 18:16:06 |
depth | 3 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
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 | 703 |
author_reputation | 353,623,611,191,427 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,864 |
net_rshares | 0 |
Can you please explain what this does? The number has me confused. >for c in steem.stream_comments(start=1898900):
author | djleo |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160717t105327379z |
category | steem |
json_metadata | {"tags":["steem"]} |
created | 2016-07-17 10:53:27 |
last_update | 2016-07-17 10:53:27 |
depth | 1 |
children | 1 |
last_payout | 2016-08-20 17:26:51 |
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 | 114 |
author_reputation | 1,834,764,955,389 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 142,325 |
net_rshares | 0 |
`steem.stream_comments()` is a generator that returns all comments when they come in. The `start` parameter just tells the starting **block**. If you leave it, it will start with the most recent block. This way, you can store the block number and continue your bot where you have left after an unexpected shutdown.
author | xeroc |
---|---|
permlink | re-djleo-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160717t111148980z |
category | steem |
json_metadata | {"tags":["steem"]} |
created | 2016-07-17 11:11:48 |
last_update | 2016-07-17 11:11:48 |
depth | 2 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.114 HBD |
curator_payout_value | 0.036 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 315 |
author_reputation | 118,819,064,085,695 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 142,640 |
net_rshares | 99,929,793,640 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
djleo | 0 | 99,918,141,582 | 100% | ||
vkoreshkoff | 0 | 11,652,058 | 100% |
I'm getting this error: sg = sendgrid.SendGridClient( AttributeError: module 'sendgrid' has no attribute 'SendGridClient'
author | djleo |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160718t040901482z |
category | steem |
json_metadata | {"tags":["steem"]} |
created | 2016-07-18 04:09:03 |
last_update | 2016-07-18 04:09:03 |
depth | 1 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
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 | 125 |
author_reputation | 1,834,764,955,389 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 159,433 |
net_rshares | 0 |
Can you please give us a link to the "python-steem library as well as piston " Thank you!!
author | hossary |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t115219005z |
category | steem |
json_metadata | {} |
created | 2016-05-30 11:52:21 |
last_update | 2016-05-30 11:52:21 |
depth | 1 |
children | 2 |
last_payout | 2016-08-20 17:26:51 |
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 | 91 |
author_reputation | 10,246,580,355,015 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,581 |
net_rshares | 0 |
author | xeroc |
---|---|
permlink | re-hossary-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160530t122147489z |
category | steem |
json_metadata | {} |
created | 2016-05-30 12:21:48 |
last_update | 2016-05-30 12:21:48 |
depth | 2 |
children | 1 |
last_payout | 2016-08-20 17:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.176 HBD |
curator_payout_value | 0.175 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 41 |
author_reputation | 118,819,064,085,695 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,613 |
net_rshares | 899,202,099,955 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xeroc | 0 | 884,917,544,305 | 100% | ||
hossary | 0 | 14,284,555,650 | 100% |
Why not an android Swiss Army Knife type of bot for Steem that can be configured to do a number of useful things and requires no coding knowledge?
author | cyberspace |
---|---|
permlink | re-xeroc-re-hossary-re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20170727t080821567z |
category | steem |
json_metadata | {"tags":["steem"],"app":"steemit/0.1"} |
created | 2017-07-27 08:08:30 |
last_update | 2017-07-27 08:08:48 |
depth | 3 |
children | 0 |
last_payout | 2017-08-03 08:08:30 |
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 | 146 |
author_reputation | 780,337,768,524 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 9,885,533 |
net_rshares | 0 |
Very interesting post. Great contribution to the community here. I will investigate this further and get my programmer buddies in on this.
author | ldauch |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20170716t042035705z |
category | steem |
json_metadata | {"tags":["steem"],"app":"steemit/0.1"} |
created | 2017-07-16 04:20:39 |
last_update | 2017-07-16 04:20:39 |
depth | 1 |
children | 0 |
last_payout | 2017-07-23 04:20:39 |
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 | 138 |
author_reputation | 1,374,860,836,555 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,635,480 |
net_rshares | 0 |
Here is an Archive of Cryptocurrency App building Code on Github for anyone creating a Steemit app https://steemit.com/steem/@marsresident/github-cryptocurrency-app-creation-archive
author | marsresident |
---|---|
permlink | re-xeroc-notification-bot-for-steem-in-30-lines-of-code-20160722t015852268z |
category | steem |
json_metadata | {"tags":["steem"],"links":["https://steemit.com/steem/@marsresident/github-cryptocurrency-app-creation-archive"]} |
created | 2016-07-22 01:59:06 |
last_update | 2016-07-22 01:59:06 |
depth | 1 |
children | 0 |
last_payout | 2016-08-20 17:26:51 |
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 | 181 |
author_reputation | 10,013,229,877,794 |
root_title | "Notification bot for Steem in 30 lines of code" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 263,961 |
net_rshares | 0 |