Skip to content

Commit

Permalink
Feature added
Browse files Browse the repository at this point in the history
get top 10 tweets from timeline
  • Loading branch information
hmangukia authored Jul 12, 2018
1 parent 7b0bad0 commit f0e095f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
import datetime
import face_recognition
import cv2
import tweepy
from tweepy import OAuthHandler
import twitterCredentials

requests.packages.urllib3.disable_warnings()
try:
Expand Down Expand Up @@ -80,8 +83,18 @@ def events(frame,put):
cv2.imwrite(path + "/" + str(name) + ".jpg", img)
cam.release()
cv2.destroyAllWindows()

#Screenshot

#get top 10 tweets
elif link[0] =="get" and link[-1] == "tweets":
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)

#Screenshot
elif put.startswith('take screenshot') or put.startswith("screenshot"):
try:
pic = pyautogui.screenshot()
Expand Down

0 comments on commit f0e095f

Please sign in to comment.