Spaces:
Runtime error
Runtime error
Commit
·
bee2fdd
1
Parent(s):
4ca63a2
initial commit
Browse files- complaintbox_appV1.py +3 -4
complaintbox_appV1.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
import tweepy
|
4 |
import time
|
5 |
import pandas as pd
|
6 |
from transformers import pipeline
|
7 |
import matplotlib.pyplot as plt
|
8 |
import gradio as gr
|
|
|
9 |
|
10 |
def twitter_auth(consumerkey,consumersecret):
|
11 |
consumer_key = consumerkey
|
@@ -31,9 +30,9 @@ def limit_handled(cursor):
|
|
31 |
except StopIteration:
|
32 |
break
|
33 |
|
34 |
-
|
35 |
-
|
36 |
def tweets_collector(query,count):
|
|
|
|
|
37 |
api = twitter_auth(consumerkey,consumersecret)
|
38 |
query = query +' -filter:retweets'
|
39 |
search = limit_handled(tweepy.Cursor(api.search,q = query,tweet_mode = 'extended',lang ='en',result_type ='recent').items(count))
|
|
|
|
|
|
|
1 |
import tweepy
|
2 |
import time
|
3 |
import pandas as pd
|
4 |
from transformers import pipeline
|
5 |
import matplotlib.pyplot as plt
|
6 |
import gradio as gr
|
7 |
+
import os
|
8 |
|
9 |
def twitter_auth(consumerkey,consumersecret):
|
10 |
consumer_key = consumerkey
|
|
|
30 |
except StopIteration:
|
31 |
break
|
32 |
|
|
|
|
|
33 |
def tweets_collector(query,count):
|
34 |
+
consumerkey = os.environ.get('consumerkey')
|
35 |
+
consumersecret = os.environ.get('consumersecret')
|
36 |
api = twitter_auth(consumerkey,consumersecret)
|
37 |
query = query +' -filter:retweets'
|
38 |
search = limit_handled(tweepy.Cursor(api.search,q = query,tweet_mode = 'extended',lang ='en',result_type ='recent').items(count))
|