Commit 1726827e authored by nanahira's avatar nanahira

random keys

parent bde963e7
Pipeline #18464 passed with stage
in 30 seconds
......@@ -6,15 +6,20 @@ import time
import json
from get_graphql_endpoint import endpoint
import threading
import random
app = Flask(__name__)
CORS(app)
TWITTER_AUTH_KEY = 'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'
twitterKeys = [
'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
'AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F',
'AAAAAAAAAAAAAAAAAAAAAAj4AQAAAAAAPraK64zCZ9CSzdLesbE7LB%2Bw4uE%3DVJQREvQNCZJNiz3rHO7lOXlkVOQkzzdsgu6wWgcazdMUaGoUGm',
]
privateKey = os.getenv('TWITTER_AUTH_KEY')
if privateKey:
TWITTER_AUTH_KEY = privateKey
twitterKeys = [privateKey]
print("Booting")
ENDPOINT = endpoint()
......@@ -47,7 +52,7 @@ isHealthy = True
def getTwitterSession():
twitter_b = OAuth2Session()
twitter_b.headers["Authorization"] = "Bearer {}".format(TWITTER_AUTH_KEY)
twitter_b.headers["Authorization"] = "Bearer {}".format(random.choice(twitterKeys))
return twitter_b
def doSearch(screen_name, twitter_b):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment