Python/RPi Tweetbot Example: CPU Temp
w0lfiesmith Aug 29th, 2013 1,785 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/usr/bin/env python
- import sys
- from twython import Twython
- import os
- CONSUMER_KEY = '***REPLACE WITH YOUR OWN*****'
- CONSUMER_SECRET = '***REPLACE WITH YOUR OWN*****'
- ACCESS_KEY = '***REPLACE WITH YOUR OWN*****'
- ACCESS_SECRET = '***REPLACE WITH YOUR OWN*****'
- api = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET)
- cmd = '/opt/vc/bin/vcgencmd measure_temp'
- line = os.popen(cmd).readline().strip()
- temp = line.split('=').split("'")
- api.update_status(status='My current CPU temperature is '+temp+' C')
RAW Paste Data