Repository that hosts code to show my genshin stats.
Automatically claims:
- daily reward
- active primo codes (from https://www.pockettactics.com/genshin-impact/codes)
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).
You will need to have or create heroku account and some website hosting that supports php scripts.
Use some free hosting or your own.
- Edit
index.php
- Change
$KEY=""
to$KEY="SOME_GENERATED_KEY"
(eg.$KEY="f54as65f156a1f6as156dc156asc61asd56a64f65as46f4as6d"
)
- Change
- Upload file
index.php
- 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
-
Create account if you don't have one
-
On dashboard click New-> Create new app
-
Name it whatever, choose a region and click
Create app
-
In the
Deploy
tab clickGitHub
You will need to authorize heroku. That should be simple. -
Configure dyno and addons
-
Click
Change Dyno Type
and make sure it's onFree
if not change it -
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.
-
Configure
Heroku Scheduler
-
Configure environment variables
- Go to
Setting
(in the app not your profile) - In
Config Vars
clickReveal Config Vars
- Set key to
GAME_UID
and value to your UID in game - Set
COOKIE
- Go to https://www.hoyolab.com/.
- Login to your account.
- Press F12 to open Inspect Mode (ie. Developer Tools).
- Go to
Console
- run
copy(document.cookie)
- Paste it into value on heroku.
- Set key to
WEB_KEY
and value to the generated key you created when you were editingindex.php
- Set key to
WEB_URL
and value to your web url
- Go to
- Edit
Procfile
Uncommentweb: ...
and comment outbot: ...
Should look something like this after you do this step\#bot: python3 main.py web: python3 main_web.py
-
Switch on web dyno
- Go to
Resources
tab - Under
Free dynos
you should seeweb python3 ...
- On the right click pen icon
- Switch it on
- Click save
- Go to
-
Get your heroku url by clicking
Open app
in the top right corner.
You can use something like cron-job.org/en/
- Set the url to your heroku app
- Run it every day at
16:30 UTC
make sure it runs at16:30 UTC
otherwise the app will not update you stats.
It only accepts requests for updating your stats between16:10 UTC
and16:40 UTC
For examplecron-job.org/en/
shows and sets the scheduled time in you timezone.
If you end up using it, then set the scheduled time to16:30
plus your UTC offset.
You can find your offset by searchingLondon utc time offset