+-+-+ +-+ +-+-+-+-+
|G|O| |4| |H|I|V|E|
+-+-+ +-+ +-+-+-+-+

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

How to count the trades using steem api

BY: @arcurus | CREATED: April 10, 2018, 8:43 p.m. | VOTES: 11 | PAYOUT: $0.56 | [ VOTE ]

Just in case you need, here a small code to query the steem api for done trades on the internal market. Its my first phyton script, so dont judge me too much :) It has no error handling at all, so make sure the trades are done right. You can check here.
Sadly the normal steem api for the default nodes did not work, so i had to switch to another node.

Much thx @crokkon for helping with the python api and choosing an functioning node.
Thx also to @holger80 he posted here a nice list about the state of current nodes.

Have fun!

```#!/usr/bin/env python

first install this:

sudo apt-get install libssl-dev

sudo pip install -U steem

if default api node not functioning use this node (use command line)

steempy set nodes https://rpc.buildteam.io

from steem.account import Account
a = Account("arcurus")
for op in a.history(filter_by=['fill_order']):
str
if op['open_owner'] == 'arcurus':
#print(op['open_owner'] + '; ' + op['current_pays'] + '; ' + op['open_pays'] + '; ' + op['timestamp']+ ';')
str = 'Trade; ' + op['current_pays'] + '; ' + op['open_pays'] + '; ' + op['timestamp'].replace('T', ' ') + ';'
else:
str = 'Trade; ' + op['open_pays'] + '; ' + op['current_pays'] + '; ' + op['timestamp'].replace('T', ' ') + ';'
print(str.replace(' SBD', '; SBD').replace(' STEEM', '; STEEM'));```

TAGS: [ #dev ] [ #steemit ]

Replies

@juvyjabian | April 13, 2018, 8:06 a.m. | Votes: 0 | [ VOTE ]

Welcome back :)

@arcurus | April 13, 2018, 9:30 a.m. | Votes: 0 | [ VOTE ]

thx, currently mainly to finish my taxes, but i posted also some ideas here:

@arcurus | April 13, 2018, 9:36 a.m. | Votes: 0 | [ VOTE ]

i think the post earnings should be fixed in steem...
For example:
- double the votes on accounts that earned less then 1000 dollar in he last year
- double the votes on accounts that earned less then 1000 dollar in he last month
- double the votes on accounts that earned less then 100 dollar in he last year
- double the votes on accounts that earned less then 100 dollar in he last month
- double the votes on accounts that earned less then 10 dollar in he last year
- double the votes on accounts that earned less then 10 dollar in he last month

Of course only for verified accounts...

@juvyjabian | April 13, 2018, 9:55 a.m. | Votes: 0 | [ VOTE ]

Are these your reward proposals?

@arcurus | April 13, 2018, 10:46 a.m. | Votes: 0 | [ VOTE ]

just came into my mind...

@juvyjabian | April 13, 2018, 12:43 p.m. | Votes: 0 | [ VOTE ]

Is it possible?

@arcurus | April 13, 2018, 1:09 p.m. | Votes: 1 | [ VOTE ]

why not, they can change everything...

@juvyjabian | April 13, 2018, 10:13 p.m. | Votes: 0 | [ VOTE ]

You seem to have a heart for everyone in the community. You wanted all to enjoy the benefits of the platform. I remember someone who also have this kind of idea, unfortunately he's out now because the big guys doesn't like it.

@abdulmanan | April 14, 2018, 7:29 a.m. | Votes: 0 | [ VOTE ]

It's great to see you here sir @holger80

@santigs | May 9, 2018, 1:07 p.m. | Votes: 0 | [ VOTE ]

I'm not able to run "sudo apt-get install libssl-dev" on a Mac, do you know how I can do it?

@arcurus | May 15, 2018, 7:42 p.m. | Votes: 0 | [ VOTE ]

sorry, im not a mac user yet. sudo... is for linux - unbuntu. I guess you can install phyton and ssl also on a mac and then run the phyton script above, or you can install a virtual machine and install unbuntu there...

@santigs | May 15, 2018, 8:22 p.m. | Votes: 0 | [ VOTE ]

Thank you, will try it on a Raspberry Pi and see if it works :)

@steemitboard | July 15, 2018, 8:25 a.m. | Votes: 0 | [ VOTE ]

Congratulations @arcurus! You have received a personal award!

[IMAGE: https://steemitimages.com/70x70/http://steemitboard.com/@arcurus/birthday2.png] 2 Years on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Play-off for third result

Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes

> Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

@steemitboard | July 15, 2019, 9:45 a.m. | Votes: 0 | [ VOTE ]

Congratulations @arcurus! You received a personal award!

https://steemitimages.com/70x70/http://steemitboard.com/@arcurus/birthday3.pngHappy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!
[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>