Advertisement
w0lfiesmith

Python/RPi Tweetbot Example: CPU Temp

Aug 29th, 2013
2,469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import sys
  3. from twython import Twython
  4. import os
  5.  
  6. CONSUMER_KEY = '***REPLACE WITH YOUR OWN*****'
  7. CONSUMER_SECRET = '***REPLACE WITH YOUR OWN*****'
  8. ACCESS_KEY = '***REPLACE WITH YOUR OWN*****'
  9. ACCESS_SECRET = '***REPLACE WITH YOUR OWN*****'
  10.  
  11. api = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET)
  12.  
  13. cmd = '/opt/vc/bin/vcgencmd measure_temp'
  14. line = os.popen(cmd).readline().strip()
  15. temp = line.split('=')[1].split("'")[0]
  16. api.update_status(status='My current CPU temperature is '+temp+' C')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement