Steem "Downvote" Explorer

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@emrebeyler·
0.000 HBD
Steem "Downvote" Explorer
<center><img src="https://ipfs.busy.org/ipfs/QmXJhVPswQTmrxHTmBgrP6niN7VegqAwiad7eoVuWfot7N">
</center>
***
<center><sup>Visit https://flags.dpoll.xyz to see it live</sup></center>
### Backstory
***

HF21 increased the overall downvote ratio in the network. However, we don't have the right tools to track the downvotes. Originally, @transisto asked a similar interface and I thought it should be considerably easy with [Hivemind](https://github.com/steemit.hivemind).

Even though Hivemind doesn't store the negative rshares in a straight forward column in the posts table, there is something we can use for ordering: **[flag_weight](https://github.com/steemit/hivemind/blob/300d5384c2f15229419cd33b044ad7440d69b83a/hive/utils/post.py#L162)**

```
# take negative rshares, divide by 2, truncate 10 digits (plus neg sign),
#   and count digits. creates a cheap log10, stake-based flag weight.
#   result: 1 = approx $400 of downvoting stake; 2 = $4,000; etc
#  flag_weight = max((len(str(neg_rshares / 2)) - 11, 0))
```
***

Seems like it's used by Condenser in the past but it also lets you order the posts by negative rshares in an indirect way. 

So a simple query like this:
```
"SELECT * FROM hive_posts_cache WHERE is_paidout=False and total_votes != up_votes and created_at > now() - interval '1 week' ORDER BY flag_weight DESC LIMIT 500;")
```
***

gets the all active posts, and orders by its flag weight and limits the result set to 500 rows. From that point, it's possible to traverse the "votes" field of the post table (CSV string) and calculate the rshares for each post.

Anyways, let me know if the interface is helpful in any way. I'll open source it once I settle things up. It's basically a single page Flask-app built in two hours, atm. Feel free to shoot in the comments for potential feature ideas. (Result set is limited to 500 rows to keep the page generation time fast.)

👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,