spencerwooo / substats

( `д′) how many followers do i have? how many!
https://substats.swo.moe
MIT License
825 stars 56 forks source link

fix: Instagram API strikes #35

Closed ArvinZJC closed 2 years ago

ArvinZJC commented 2 years ago

There are 2 necessary changes required:

  1. Additional environment variables IG_EMAIL and IG_PWD: an Instagram account disabling two-factor authentication is required.
  2. KV namespace configuration: see the relevant docs. In brief, one way is to use the command wrangler kv:namespace create "KV" <--preview> and add the console output as follows to the file wrangler.toml
kv_namespaces = [
    { binding = "KV", id = "XXX", preview_id = "XXX" }
]

Please note that binding must have the value KV. With all these configured, this PR should solve #33, though limitations exist.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/spencerwoo/substats/DoNQHmah7Wb7JEqn5nRk9EP9xDYn
✅ Preview: https://substats-git-fork-arvinzjc-master-spencerwoo.vercel.app

spencerwooo commented 2 years ago

closing this in favor of new release

ArvinZJC commented 2 years ago

哥哥真棒

spencerwooo commented 2 years ago

要是用 KV 来持久化 Cookie 的话,这里有个例子:

https://github.com/spencerwooo/substats/blob/63b8902436df225f905ff1d1ba02b85c759f851f/src/providers/inoreader.ts#L7-L46

Instagram 的话原理是一样的,但是我也不知道为什么我 Inoreader 就是拿不到 Cookie,你要不要试试?目前手动设置的 Cookie 是一个月 Expire 的。

ArvinZJC commented 2 years ago

要是用 KV 来持久化 Cookie 的话,这里有个例子:

https://github.com/spencerwooo/substats/blob/63b8902436df225f905ff1d1ba02b85c759f851f/src/providers/inoreader.ts#L7-L46

Instagram 的话原理是一样的,但是我也不知道为什么我 Inoreader 就是拿不到 Cookie,你要不要试试?目前手动设置的 Cookie 是一个月 Expire 的。

好嘞,加 TODO 了,容我先完成一些其他的 tasks 🐌