Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion jobtweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,18 @@ def get_tweets(self, query, count = 10):

def main():
api = TwitterClient()
tweets = api.get_tweets(query = 'Job Opportunities', count = 500)

tweets = []
subjects = []
cli = raw_input("Enter prompt to search: ")

for everycomma in cli.split(','):
#print(everycomma)
subjects.append(everycomma.strip(" "))
#print(subjects)
for temp in subjects:
tweets += (api.get_tweets(query = temp, count = 500))

ptweets = [tweet for tweet in tweets if tweet['sentiment'] == 'positive']

print("Positive tweets percentage: {} %".format(100*len(ptweets)/len(tweets)))
Expand Down