From 027b1f597da6129d8199a235b244992541600d08 Mon Sep 17 00:00:00 2001 From: Ching Date: Tue, 26 Mar 2024 17:40:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=84=9A=E6=9C=AC=E9=87=8D=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mas2ff2.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mas2ff2.py b/mas2ff2.py index 464cfac..de63031 100644 --- a/mas2ff2.py +++ b/mas2ff2.py @@ -157,15 +157,13 @@ def run(instance, access_token, fanfou_cookie, fanfou_token): time.sleep(10) - while True: - requests.get('https://up.tunpok.com/api/push/sQLwSpeiUH?msg=OK&ping=') - # get new status + # get every new status + while min_id: me_timeline = mastodon_cli.account_statuses( me_id, exclude_replies=True, min_id=min_id) # if no new status if not me_timeline: - time.sleep(10) - continue + break statuses = [] for status in me_timeline: statuses.append(status) @@ -185,6 +183,8 @@ def run(instance, access_token, fanfou_cookie, fanfou_token): # update min_id if statuses: min_id = statuses[-1]['id'] + else: + min_id = None if __name__ == '__main__': cookie = 'u=stokesia; uuid=24edfe42401cbb03cf1f.1676446846.21; PHPSESSID=d4l9m3tp09gasff6r3u8mv9p12; m=yvettezhong%40gmail.com; tgw_l7_route=f174d6f255742a6ee2e9a07cf9cca0fa'