SteemSnippets 1.2.3 : Power up, get active votes and get lastest posts from tags

image.png

Hello,

steemsnippets is a project that I really like but with my work with steempress and since I've covered most of the usual snippets I don't get to add new snippets very often.

But recently I added a big one and so I figured I'd do a post to let you guys know about the new snippets that I've been adding over the last month.

Special mention to @tdre who submitted two pull requests to add a snippet and fix various things :)

New snippets :

Get active votes

By "active votes" I mean "votes on posts that are awaiting payout". This was harder than expected. Because you can't just look at the date of the vote and be like "ok this vote is younger than 7 days so it's active". Because if you vote on a 5 days old post, your vote will be 3 days old when the post will get its payout.

So I had to go for this workflow :

  • get all the votes of one account
  • Look at those who are younger then 6 days
  • Look at the posts of those votes and check their ages
  • If these posts are younger than 6 days THEN we add them to the "active posts" list.

I check the date of the votes first so I don't have to look over every single post but rather only the one we suspect to be active.

https://github.com/drov0/steemsnippets/commit/5672ed3ab6220ccd19e3a7f0735a994d36ac05b9

Power up

This snippet allows you to easily power up from your balance to steem, I needed that for the https://github.com/drov0/Steem-reward-manager

It's really straightforward, just make sure that the "amount" field follow the steem way of writing things : it must be written like this : x.xxx unit eg : '1.265 STEEM' or '0.010 STEEM'

https://github.com/drov0/steemsnippets/commit/f70f32b742a59ec3a4cf5679396d2397034a5142

Get lastest posts

Made by @tdre

This snippet allows you to query the blockchain to get the latest posts of a tag. This is very usefull if you want to try to make a statistics bots or create your own front end.

What's really important here is that the query is documented.

https://github.com/drov0/steemsnippets/commit/170d23c71780ab86a65b95f2c88b8f5febdd2aee

The project is open source so feel free to submit pull requests with your own snippets :)

@howo



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now