This update does not change anything visible to the user but a lot in the background. There's now an API to fetch the necessary data for the websites. This makes it easier to extend and reduced code duplication dramatically.
I also think it would be nice to story the data in an own database, in addition to the blockchain. Simply to have quicker and more independent access. Then, at the latest, it makes totally sense to do that.
Starting with just the delegators, to fix an "exposed key issue"... I soon thought, that it might be quite handy to have endpoints for all the data, like posts, contributors, current submissions and so on.
/delegators: Returns all delegators, order by SP.
/contributors: Returns all users who have contributed to a story, together with their total number of contributions, ordered by that number.
/submissions: Returns all currently voteable submissions, order by votes.
/stories: Returns the last post for each story that exists.
/storyposts: Returns all posts that belong to a story.
To chose which instance of the Magic Frog is concerned, an
account parameter is needed.
So, for example, to get a list of all users that have contributed to a story in the English instance, call:
I'm using express for the first time here. Feel free to have a look at the code and give me feedback.
The API is a new repo of course so I won't list commits here. But have fun with the first few commit messages. I tried to write them as a story but then forgot about it and broke the story. :D
- Error handling should be a bit more verbose.
- The bot still needs to be adjusted to make use of the API.
- If needed, there will be more endpoints of course. But for now there's nothing specific on my mind.
- Set up own DB and connect it with the API.
Get in touch
If you want to get in touch with me and other community members, the preferred way is now our discord. There's not much going on there yet but I'm sure this will change overtime. We need creative minds! If you are, join!