Last active
August 29, 2015 14:27
-
-
Save lakshmankumar12/6a6565a2c087f33c2caa to your computer and use it in GitHub Desktop.
Push bullet sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from pushbullet import Pushbullet | |
import sys | |
if len(sys.argv) != 2: | |
print "Usage %s <message>"%sys.argv[0] | |
sys.exit(1) | |
api_key = '32_char_Key_from_pushbullet' | |
pb = Pushbullet(api_key) | |
try: | |
motog = [ i for i in pb.devices if 'Moto G' in str(i) ][0] | |
except IndexError: | |
print "Huh: couldn't find Moto G in %s"%pb.devices | |
sys.exit(1) | |
motog.push_note("messgae from script", sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment