English | 中文
A mixin bot that offers an up-to-date ahr999 index for the subscribed users, and a web page that provides historical data chart of the index.
website: https://zed-wong.github.io/ahr999-mixin/
mixin bot: 7000103262
-
Register a bot at https://developers.mixin.one/
-
Generate new client secrets
-
Run
git clone github.com/zed-wong/ahr999-mixin
-
Fill main.go with your credential
ClientID = ""
SessionID = ""
PrivateKey = ""
PinToken = ""
Pin = ""
- Run
go run main.go
, then access your bot in mixin messenger.
-
Rent a Ubuntu server (vultr.com or digitalocean.com)
-
Install nginx on your server
-
Run
git clone github.com/zed-wong/ahr999-mixin
on your server.(not needed if you have done this before.) -
Copy index.html and main.py to /var/www/html/
-
Run
python3 main.py
in /var/www/html -
Access your website through your server's ip, then the chart should be there.
-
Run
crontab -e
, append0 0 * * * python3 /var/www/html/main.py
to the end of file to make it executed everyday.
-
main.go
- Execute every 24 hours to notify the index.
- Notify with mixin when the index hit the line.
- Handles the bots message module, writes subbed userid to database.
-
main.py
- Execute every day to keep data.json up to date.
-
index.html
- The webpage of ahr999 charts.
-
data.json
- A JSON file that contains timestamp and ahr999 index.
-
data.db
- Stores subscribed users.