Skip to content

Using GitHub Issue Reactions to vote. 使用 GitHub Issue Reactions 进行投票

License

Notifications You must be signed in to change notification settings

dreamjz/github-issue-vote

Repository files navigation

github-issue-vote

English | 简体中文

Using GitHub Issue Reactions to vote.

If you like this repo, please consider giving it a star (o゜▽゜)o☆ . Thank you OwO.

Example

Here is an example in github.com/acgtools/hanime-hunter

Check here and chooes a reaction: Pure Love Knight ❤️, NTR Warrior:🚀

Quick Start

Fork this repo and deploy

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.

Make modification

You need to make some modifications to fit your own needs.

Issue Reactions

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;
}

Vote class

./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   
  }

About

Using GitHub Issue Reactions to vote. 使用 GitHub Issue Reactions 进行投票

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published