
Repositories
https://github.com/mktcode/the-magic-link (new)
https://github.com/mktcode/the-magic-frog
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.
Endpoints
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.
https://api.the-magic-frog.com
/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:
https://api.the-magic-frog.com/contributors?account=the-magic-frog
All the endpoints support only the account names that actually host a Magic Frog instance ( ,
,
).
Implementation
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
Updated Frontend/Website
Commits:
- https://github.com/mktcode/the-magic-frog/commit/ab186422fea8bb5c9fb1ad6e0537f6a01058d43b
- https://github.com/mktcode/the-magic-frog/commit/139040c6c093f5114f9301aa92a5dc4f2a891bb2
- https://github.com/mktcode/the-magic-frog/commit/d601530a303442743bbe6793f588f936ddce14df
Roadmap
- 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!
Stay tuned and happy storytelling!
Visit:
the-magic-frog.com
de.the-magic-frog.com
fr.the-magic-frog.com
the-magic-frog.com
de.the-magic-frog.com
fr.the-magic-frog.com