Skip to content

Commit

Permalink
Sort bearers by most recent success & fix deploy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpdx committed May 21, 2024
1 parent ff07ddc commit e192f9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: 'npm'

- name: Install packages
run: npm install -g serverless
run: npm install -g serverless@3.25.1

- name: Install serverless-wsgi
run: serverless plugin install -n serverless-wsgi
Expand Down
5 changes: 5 additions & 0 deletions twExtract/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def cycleBearerTokenGet(url,headers):
# try another bearer token
print(f"Error 429 but {rateLimitRemaining} remaining")
continue
else:
# move successful token to the front if it's not already there
if token != bearerTokens[0]:
bearerTokens.insert(0,bearerTokens.pop(bearerTokens.index(token)))
return tweet
except Exception as e:
pass
return tweet
Expand Down

0 comments on commit e192f9a

Please sign in to comment.