-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] Add click counter #1
Comments
But click counter like this will break the idea of static site, won't it? |
We can just read/write the counter to a |
But github pages provides only static page hosting. There's no way to edit some files there. |
A global counter would probably be doable via Ajax and an external server, whilst still being a static site. |
You are right. My brain not working yesterday 😋
How about using headless CMS like |
Whatever platform/service its going to be implemented on is probably irrelevant in this context (I reckon the discussion is about platelet-clicker and not platelets.fun). How it will be implemented is the question here, perhaps decide on endpoint names so whoever wants to run their own instance can just swap out a variable and point it to their own "counter" server. |
And the other question is WHEN we should send updates about count. Another question is security: the user might cheat and manipulate counter: increase its value too fast or decrease it. What comes to mind:
This will require not only simple JSON file, but also database to save information about tokens, like time of last delta submit. But this will not allow user to manipulate counter easily. Another attack vector is getting many tokens at time and "clicking" it at the same time. Don't know what how to disallow this. |
One way to go about this is the server should only accept the submission if the time since last submission is With this, the problem of "how often" becomes irrelevant since the server won't be accepting submissions that are sooner than the allowed frequency. This just becomes an issue of not hammering the server with too much requests. About the exploit about getting many tokens and "clicking" on them all at once, there's no clear-cut way of preventing this and I think can be let off considering this is supposed to be simple web app. Sure someone can write a script that requests an obscene amount of tokens but since rate-limiting is in place some of the effects are mitigated (they're essentially capped to |
In terms of programming language: the easiest choice is PHP. A LOT of servers and hostings (including free of charge ones) support it. But it will be very problematic to code with it... |
Since it is a simple web app, why dont we make the whole thing server side and rent a $5 vps on digital ocean ? |
The idea is not to have only platelets.fun service, but a platelet-clicker project, that can be set up easily be anyone interested. That's why I offer PHP. Of course it can be anything like |
A reference implementation in Node.js can now be found over at platelet-counter. Next step would be integrating the API into platelet-clicker. |
Like http://nyanpass.com/
The text was updated successfully, but these errors were encountered: