Skip to content

Commit

Permalink
Merge pull request #128 from hmangukia/master
Browse files Browse the repository at this point in the history
Under issue #3, feature added.
  • Loading branch information
the-ethan-hunt authored Jul 12, 2018
2 parents 7b0bad0 + 78cd083 commit 428f3bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ ENV/

# mypy
.mypy_cache/

# Credentials to access twitter
twitterCredentials.py
2 changes: 2 additions & 0 deletions windows/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ List of the things that B.E.N.J.I. can do:
* Create a file(txt, docx, pptx,xlsx, vsdx and rtf supported)
* Podcast
* Calculator
* Get top 10 tweets

Keep reading to see how to do all the above mentioned jobs with B.E.N.J.I.

Expand Down Expand Up @@ -124,6 +125,7 @@ NOTE: All the recorded files will be saved on the desktop. Make sure that the fi
* "***podcast***". This will redirect you to "CastBox" which is a good source of podcasts.
* "***calculator***". This will open Calculator.
* "***exit/over/close/stop*** to exit BENJI.
* "***get tweets***" get latest 10 tweets from timeline. For this an app is to be registered at https://apps.twitter.com/ (if confused, have a look at https://spring.io/guides/gs/register-twitter-app/). A new file named "twitterCredentials.py" is to be made in the windows folder. Save the consumer key, consumer secret, access token, access token secret with the names consumer_key, consumer_secret, access_token, access_secret repectively in the "twitterCredentials.py"


>In cases where the commands are separated by '/', use any one of the mentioned commands
Expand Down
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
1 change: 1 addition & 0 deletions windows/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ SpeechRecognition==3.7.1
sympy==1.1.1
tempdir==0.7.1
traitlets==4.3.2
tweepy==3.3.0
urllib3==1.22
wcwidth==0.1.7
wikipedia==1.4.0
Expand Down

0 comments on commit 428f3bc

Please sign in to comment.