-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsendTweetArduino.py
More file actions
32 lines (23 loc) · 902 Bytes
/
sendTweetArduino.py
File metadata and controls
32 lines (23 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import tweepy
from datetime import datetime
#import serial
import time
localtime = time.asctime( time.localtime(time.time()) )
#ser = serial.Serial('/dev/tty.usbmodem1421')
#serStr = ser.read();
# Consumer keys and access tokens, used for OAuth
consumer_key = 'FADWhr61GVD5WB9tFCbzEqvHv'
consumer_secret = 'CGwgkZNTRmKHL4SBoxeO9PqVELjkbauytSwfULZWkBxcJqu2Da'
access_token = '3103176043-rYcrr6qlLDwKfyJHEeGXJeOlfDR7Hj0mHQQKZjU'
access_token_secret = 'H8nUgGH1zz1aJScCz60qfG5EXVWwjHpJxucEVvHLM84PG'
# OAuth process, using the keys and tokens
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
# Creation of the actual interface, using authentication
api = tweepy.API(auth)
def tweetNow():
tweet_text = raw_input("Enter a tweet:")
api.update_status(status=tweet_text +
" Time:\n " + str(localtime))
while True:
tweetNow()