Skip to content

Instantly share code, notes, and snippets.

@lakshmankumar12
Last active August 29, 2015 14:27
Show Gist options
  • Save lakshmankumar12/6a6565a2c087f33c2caa to your computer and use it in GitHub Desktop.
Save lakshmankumar12/6a6565a2c087f33c2caa to your computer and use it in GitHub Desktop.
Push bullet sample
#!/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