create account

Design decisions on a library: A new event listener idea on Lightsteem by emrebeyler

View this thread on: hive.blogpeakd.comecency.com
· @emrebeyler · (edited)
$7.70
Design decisions on a library: A new event listener idea on Lightsteem
#### Streaming blockchain for the incoming transfers of a specific account
***

```python
events = EventListener(client)

for transfer in events.on('transfer', filter={"to": "emrebeyler"}):
    print(transfer)
```

#### Streaming for incoming witness vote actions
***

```python
events = EventListener(client)

for witness_vote in events.on('account_witness_vote', filter={"witness": "emrebeyler"}):
    print(witness_vote)
```

#### Callables (Filtering on conditions)
***

Let's get the comments and posts tagged with utopian-io:

```python
def filter_tags(comment_body):
    return "utopian-io" in comment_body["json_metadata"]["tags"]:


for op in events.on("comment", condition=filter_tags):
    print("only comments has a tag with utopian-io")
```

#### Stream everything
***

```python
for op in events.stream():
    print(op)
```

#### Hooks
***

```python
events = EventListener(client)

def send_to_discord(data):
	# r = requests.post(...)
	pass

for witness_vote in events.on('account_witness_vote', 
	    filter={"witness": "emrebeyler"}, 
	    hook=send_to_discord):
    print(witness_vote)
```
***

Any thoughts?
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 153 others
properties (23)
authoremrebeyler
permlinkdesign-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem
categorylightsteem
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["lightsteem","python","programming","busy"],"users":[],"links":[],"image":[]}
created2018-09-13 07:14:54
last_update2018-09-13 07:22:12
depth0
children5
last_payout2018-09-20 07:14:54
cashout_time1969-12-31 23:59:59
total_payout_value6.811 HBD
curator_payout_value0.889 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,126
author_reputation448,528,959,341,273
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,152,780
net_rshares7,155,007,462,955
author_curate_reward""
vote details (217)
@felixxx ·
$0.03
I use the word _event_ a lot in this context, when I try to explain my code in plain words.

I am deep into my JS project, but I hope I can make use of lightsteem some time in the future.
👍  ,
properties (23)
authorfelixxx
permlinkre-emrebeyler-design-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem-20180913t073421652z
categorylightsteem
json_metadata{"tags":["lightsteem"],"app":"steemit/0.1"}
created2018-09-13 07:34:18
last_update2018-09-13 07:34:18
depth1
children2
last_payout2018-09-20 07:34:18
cashout_time1969-12-31 23:59:59
total_payout_value0.023 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length187
author_reputation214,843,689,236,545
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,153,966
net_rshares28,492,177,289
author_curate_reward""
vote details (2)
@emrebeyler ·
How is the wallet going on?
properties (22)
authoremrebeyler
permlinkre-felixxx-re-emrebeyler-design-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem-20180913t074242154z
categorylightsteem
json_metadata{"tags":["lightsteem"],"app":"steemit/0.1"}
created2018-09-13 07:42:42
last_update2018-09-13 07:42:42
depth2
children1
last_payout2018-09-20 07:42:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length27
author_reputation448,528,959,341,273
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,154,486
net_rshares0
@felixxx ·
$0.03
I have the backend figured out ( comes with steem-js pretty much )

I am stuck with UI decisions and my latest idea is to just go retro; 800x600 and style it pixel by pixel.
I am not sure how to proceed and I am waiting for another rush of inspiration ...
👍  ,
properties (23)
authorfelixxx
permlinkre-emrebeyler-re-felixxx-re-emrebeyler-design-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem-20180913t075041686z
categorylightsteem
json_metadata{"tags":["lightsteem"],"app":"steemit/0.1"}
created2018-09-13 07:50:39
last_update2018-09-13 07:50:39
depth3
children0
last_payout2018-09-20 07:50:39
cashout_time1969-12-31 23:59:59
total_payout_value0.024 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length255
author_reputation214,843,689,236,545
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,155,003
net_rshares28,810,724,746
author_curate_reward""
vote details (2)
@isnochys ·
Those are the droids I am looking for
👍  
properties (23)
authorisnochys
permlinkre-emrebeyler-design-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem-20180913t073219856z
categorylightsteem
json_metadata{"tags":["lightsteem"],"app":"steemit/0.1"}
created2018-09-13 07:32:21
last_update2018-09-13 07:32:21
depth1
children1
last_payout2018-09-20 07:32:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length37
author_reputation48,490,072,901,013
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,153,858
net_rshares6,015,888,896
author_curate_reward""
vote details (1)
@emrebeyler ·
https://media.giphy.com/media/5xaOcLOqNmWHaLeB14I/giphy.gif
properties (22)
authoremrebeyler
permlinkre-isnochys-re-emrebeyler-design-decisions-on-a-library-a-new-event-listener-idea-on-lightsteem-20180913t074029455z
categorylightsteem
json_metadata{"tags":["lightsteem"],"image":["https://media.giphy.com/media/5xaOcLOqNmWHaLeB14I/giphy.gif"],"app":"steemit/0.1"}
created2018-09-13 07:40:30
last_update2018-09-13 07:40:30
depth2
children0
last_payout2018-09-20 07:40:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length59
author_reputation448,528,959,341,273
root_title"Design decisions on a library: A new event listener idea on Lightsteem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,154,340
net_rshares0