Skip to content

Commit

Permalink
Removed Conflicts with Twitter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik-Sanghani committed Jul 19, 2018
1 parent 0500c25 commit 6d524f8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ def events(frame,put):
print("By ", status.user.screen_name, " at ", status.user.created_at)

#Get friends from twitter
elif link[-3] == "follow" and link[-1] == "twitter":
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
auth.set_access_token(twitterCredentials.access_token, twitterCredentials.access_secret)
api = tweepy.API(auth)
for friend in tweepy.Cursor(api.friends).items():
print("\nName: ", json.dumps(friend.name), " Username: ", json.dumps(friend.screen_name))

elif len(link[-1]) == "twitter":
if link[-3] == "follow" and link[-1] == "twitter":
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
auth.set_access_token(twitterCredentials.access_token, twitterCredentials.access_secret)
api = tweepy.API(auth)
for friend in tweepy.Cursor(api.friends).items():
print("\nName: ", json.dumps(friend.name), " Username: ", json.dumps(friend.screen_name))

#Screenshot
elif put.startswith('take screenshot') or put.startswith("screenshot"):
try:
Expand Down Expand Up @@ -416,7 +417,7 @@ def main():
print("Error")
speak.say("Sorry Graph can not be Plotted")
speak.runAndWait()

# elif put.startswith(search_pc):
# process=subprocess.Popen("dir /b/s "+link[1],shell=True,stdout=subprocess.PIPE)
# while True:
Expand Down

0 comments on commit 6d524f8

Please sign in to comment.