As I wait for an answer to my previous problem I realize that I still have code that works that I can build off of. Time to do something productive instead of banging my head against a wall.
Anyone can copy and paste this code into a file and save it as .html
When you open the file it will open a tab in your default browser and look something like this:
You can confirm that this is correct by looking directly on Steemit:
https://steemit.com/created/tutorial
We see that the script worked and returned exactly what we were looking for: The top 100 posts that were most recently created with the "tutorial" tag.
Apparently, the cap for how many posts you can request at a time is limited to 100. As someone who wants to build a filter for the Steemit tabs this is very annoying but I'm sure I'll find a workaround later.
Change the limit to more than 100 to see for yourself:
In order to see these errors you can hit F12 while in Google Chrome.
Okay! We got 100 posts! Let's filter them.
The JavaScript we ran returned 100 "Discussion" objects. What do we have to work with here? Well, first of all, each discussion has an "Author" object. Scratch that... it looks like the "Author" attribute is just a simple string. I wanted to filter these discussions by deleting posts of Authors that had accounts worth less than $100. However, scanning the dsteem github it appears that this information is stored in an object called "Account".
Discussions don't seem to have a link to Accounts, so I'd have to find a function that retrieves accounts from Steem using the Author string. This function might have to get called 100 times... which might take a while... so I'll just use a different filter for now.
Discussions have an attribute called "author_reputation". Gee, I wonder what that could be. Let's use this attribute to reorganize the 100 posts we got in order of highest reputation to least:
By running this code the order of all 100 posts has gone from highest reputation to least. I was very surprised to see that I was only #12 on this list; was expecting higher.
We can see that @ace108 (73) and @steemmonsters (71) are at the top of the list with massive reputations.
This isn't meant to be a smart way to order posts, it's meant to be the simplest example possible to show you all exactly how easy it is to filter the trending, hot, new, and promoted tab.
In the future I will extend this concept further to show just how simple it is to bring my ideas to life. The trending and hot tabs are an absolute joke. They are the reason why bid-bots and vote buying exist. I aim to make them obsolete with a superior filter and curation system. Of course, you are certainly willing to tag along or even help the process. Proof of brain for the win.
Just look at how much information is stored in a Discussion: https://jnordberg.github.io/dsteem/interfaces/discussion.html
We could be filtering posts based on any of this massive amount of info (and more), but instead we are just ordering them according to how much they are getting paid. On a platform of vote buying, this means nothing. We need a better way.
Part 0: Steem Tutorials Are Severely Lacking
Return from JavaScript Dsteem Tutorial (Part 1: Filtering 'New' Tab) to edicted's Web3 Blog