Skip to content

Commit

Permalink
Twitter feature enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
hmangukia committed Jul 12, 2018
1 parent 428f3bc commit cbc5844
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from oauth2client import tools
from oauth2client.file import Storage
import datetime
import face_recognition
#import face_recognition
import cv2
import tweepy
from tweepy import OAuthHandler
Expand Down Expand Up @@ -89,10 +89,21 @@ def events(frame,put):
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
auth.set_access_token(twitterCredentials.access_token, twitterCredentials.access_secret)
api = tweepy.API(auth)

for status in tweepy.Cursor(api.home_timeline).items(10):
print("\n", status.text)
print("By ", status.user.screen_name, " at ", status.user.created_at)
if link[-2] == "my":
for tweet in tweepy.Cursor(api.user_timeline).items(10):
print("\n", json.dumps(tweet.text))
print("on ", tweet.created_at)
elif link[1] == "tweets":
for status in tweepy.Cursor(api.home_timeline).items(10):
print("\n", status.text)
print("By ", status.user.screen_name, " at ", status.user.created_at)

elif link[-2] == "twitter" and link[-1] == "friends":
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"):
Expand Down Expand Up @@ -804,7 +815,7 @@ def createOutputWindow(self):
#Trigger the GUI. Light the fuse!
if __name__=="__main__":

#Face detection
"""#Face detection
path = 'C:/'
lisdir = os.listdir(path)
flag = 0
Expand All @@ -822,7 +833,7 @@ def createOutputWindow(self):
ret, img = cam.read()
cv2.imwrite(path + "/" + str(name) + ".jpg", img)
cam.release()
cv2.destroyAllWindows()
cv2.destroyAllWindows()"""

#GUI
root = tk.Tk()
Expand Down

0 comments on commit cbc5844

Please sign in to comment.