Skip to content

Commit 9074230

Browse files
committed
fixed username string
1 parent 67ac08b commit 9074230

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tsa_app/tweetanalyzer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ def tweet_analyzer(keywords='', username='', option=1):
148148
return 'try again'
149149
else:
150150
# fetch tweets from a user
151-
username = '@' + username
151+
if username[0] != '@':
152+
username = '@' + username
153+
152154
try:
153155
tweets = api.user_timeline(username, count=500, tweet_mode='extended')
154156
input['username'] = username

0 commit comments

Comments
 (0)