Skip to content

Repository that host code to show my genshin stats. Claims daily reward and new primo codes.

Notifications You must be signed in to change notification settings

tehrzky/genshinstats

 
 

Repository files navigation

Genshin stats

Repository that hosts code to show my genshin stats.
Automatically claims:

My stats

❗NOTICE❗

Once heroku removes free tier at 28.11.2022 or sooner, then this branch will no longer be supported. It will be deleted and replaced by deta branch.

Also deta branch is now in testing phase so it won't be that long (few days or weeks).

Setup

You will need to have or create heroku account and some website hosting that supports php scripts.

GitHub

  1. Fork this repo
  2. Change website url
    1. Click the pen icon
      image
    2. Edit 8th line to [My stats](YOUR_WEBSITE_URL)

Website

Use some free hosting or your own.

  1. Edit index.php
    1. Change $KEY="" to $KEY="SOME_GENERATED_KEY" (eg. $KEY="f54as65f156a1f6as156dc156asc61asd56a64f65as46f4as6d")
  2. Upload file index.php
  3. Load the page and make sure it's not showing any errors, you should see a blank page or a warning that page.html is missing

Heroku

  1. Create account if you don't have one

  2. On dashboard click New-> Create new app image

  3. Name it whatever, choose a region and click Create app

  4. In the Deploy tab click GitHub
    You will need to authorize heroku. That should be simple.

  5. Click Search find genshin-stats repo and click Connect image

  6. Enable automatic deploys on main branch image

  7. Configure dyno and addons

    1. Uncheck the switch if its on.
      image

    2. Click Change Dyno Type and make sure it's on Free if not change it image

    3. In addons search for heroku scheduler and click on it image

    4. Click Submit Order Form
      If you don't have verified account this won't work!

      For verification you will need to add a payment method.
      Don't worry you won't be charged anything.
      After that you will have 1000 free dyno hours per month.
      I am running app that runs for about 30 seconds every hour and it uses at max 6 hours a month.
      So you will be fine.

      If you can't verify your account skip to Configure environment variables, but if you can verify it definitely do that. It's a much better approach.

      image

  8. Configure Heroku Scheduler

    1. Click on Heroku Scheduler (in Resources tab)
    2. Click Create job
    3. Set it to run every day at 4:30 PM and command to python3 main.py (you should also see the dyno as Free) image
    4. Click Save Job
  9. Configure environment variables

    1. Go to Setting (in the app not your profile)
    2. In Config Vars click Reveal Config Vars
    3. Set key to GAME_UID and value to your UID in game
    4. Set COOKIE
      1. Go to https://www.hoyolab.com/.
      2. Login to your account.
      3. Press F12 to open Inspect Mode (ie. Developer Tools).
      4. Go to Console
      5. run copy(document.cookie)
        image
      6. Paste it into value on heroku.
    5. Set key to WEB_KEY and value to the generated key you created when you were editing index.php
    6. Set key to WEB_URL and value to your web url
  10. Add a buildpack
    image

    1. Click Add buildpack
    2. Paste https://github.com/HANDZCZ/heroku-buildpack-run.git into Enter Buildpack URL image
    3. Click Save chages
    4. Make sure that heroku/python is first image
  11. In Deploy tab run manual deploy image Wait for it to finish image

For those who can't verify their account

GitHub

  1. Edit Procfile
    Uncomment web: ... and comment out bot: ... Should look something like this after you do this step\
    #bot: python3 main.py
    web: python3 main_web.py

Heroku

  1. Switch on web dyno

    1. Go to Resources tab
    2. Under Free dynos you should see web python3 ...
    3. On the right click pen icon
    4. Switch it on
    5. Click save
  2. Get your heroku url by clicking Open app in the top right corner.

Cron service

You can use something like cron-job.org/en/

  1. Set the url to your heroku app
  2. Run it every day at 16:30 UTC make sure it runs at 16:30 UTC otherwise the app will not update you stats.
    It only accepts requests for updating your stats between 16:10 UTC and 16:40 UTC
    For example cron-job.org/en/ shows and sets the scheduled time in you timezone.
    If you end up using it, then set the scheduled time to 16:30 plus your UTC offset.
    You can find your offset by searching London utc time offset

About

Repository that host code to show my genshin stats. Claims daily reward and new primo codes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Mako 77.3%
  • Python 19.6%
  • PHP 2.8%
  • Other 0.3%