tracinginsights commited on
Commit
63a8ce1
·
1 Parent(s): 882c804

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -7,6 +7,7 @@ import time
7
  from bs4 import BeautifulSoup
8
  import re
9
  import numpy as np
 
10
 
11
  from flair.data import Sentence
12
  from flair.models import SequenceTagger
@@ -28,6 +29,12 @@ demo.launch(max_threads=1, show_api=False)
28
 
29
  URL = "https://www.formula1.com/content/fom-website/en/latest/all.xml"
30
 
 
 
 
 
 
 
31
  def get_xml(url):
32
  # xpath is only for formula1
33
  # use urllib.parse to check for formula1.com website or other news
@@ -176,12 +183,7 @@ def get_speaker_quotes(dfs_dict, question_answerer):
176
  return speaker_quote
177
 
178
 
179
- api_key = "Ua2l5yDMiS1sMZUIJlU6sIAPF"
180
- secret_api_key = "N3AtrZQ7wYmUfoJuG7zdvSTrZSEWT8p6VwgmNYsLyGC1OHN15I"
181
- access_token = "1438916815980171264-SFsqSXgn0oSqdkpsXbSvOLhmDKFkVh"
182
- secret_access_token = "R7RXNROT6lVLQ8SEEk0iZr7D6NINJpTqy57tkMEgjeAJq"
183
 
184
- bearer_token = "AAAAAAAAAAAAAAAAAAAAALi8iwEAAAAAXsnZnVR7KNbf%2B6k0dTYY4Rkv%2Bso%3DMzxbsVnMQv6yuWazmCRxPOCPgLuujmGl4SLrdCCvcBFKxc9YgL"
185
 
186
  def post_to_twitter():
187
  twitter_api_key = api_key
 
7
  from bs4 import BeautifulSoup
8
  import re
9
  import numpy as np
10
+ import os
11
 
12
  from flair.data import Sentence
13
  from flair.models import SequenceTagger
 
29
 
30
  URL = "https://www.formula1.com/content/fom-website/en/latest/all.xml"
31
 
32
+ api_key = os.environ['api_key']
33
+ secret_api_key = os.environ['secret_api_key']
34
+ access_token = os.environ['access_token']
35
+ secret_access_token = os.environ['secret_access_token']
36
+ bearer_token = os.environ['bearer_token']
37
+
38
  def get_xml(url):
39
  # xpath is only for formula1
40
  # use urllib.parse to check for formula1.com website or other news
 
183
  return speaker_quote
184
 
185
 
 
 
 
 
186
 
 
187
 
188
  def post_to_twitter():
189
  twitter_api_key = api_key