English | 简体中文
Using GitHub Issue Reactions to vote.
If you like this repo, please consider giving it a star (o゜▽゜)o☆ . Thank you OwO.
Here is an example in github.com/acgtools/hanime-hunter
Check here and chooes a reaction: Pure Love Knight ❤️, NTR Warrior:🚀
Fork this repo and deploy your own Vercel service.
You can set the environment variable
GITHUB_ISSUE_VOTE_API
to your own GitHub personal token to increase the GitHub API rate limit.
You need to make some modifications to fit your own needs.
app.ts
:
interface IssueReaction {
...
total_count: number; // the total count of all reactions
...
laugh: number;
hooray: number;
confused: number;
heart: number;
rocket: number;
eyes: number;
}
./lib/vote.ts
:
class Vote {
// change these fields to fit your needs
private heart: number;
private rocket: number;
constructor(heart: number, rocket: number ) {
this.heart = heart;
this.rocket = rocket;
}
generateSvg(): string {
// calculate the result and render the svg
}