Skip to content

Instantly share code, notes, and snippets.

@WardsParadox
Created November 15, 2016 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WardsParadox/76ba3b26491da5ff6a294051b5e16d2c to your computer and use it in GitHub Desktop.
Save WardsParadox/76ba3b26491da5ff6a294051b5e16d2c to your computer and use it in GitHub Desktop.
boxcarNotify.py
#!/usr/bin/python
'''
Sends boxcar.io notifications, you need a token so sign up at boxcar.io!
'''
try:
import requests
except ImportError:
print 'Please install requests'
defaulticon = "https://github.com/munkireport/munkireport-php/raw/wip/assets/images/favicons/android-chrome-192x192.png"
def boxcarnotify(accesstoken, title, message, sound="success",
icon=defaulticon, source_name="Box Car Test"):
url = "https://new.boxcar.io/api/notifications"
data = {}
data["user_credentials"] = accesstoken
data["notification[title]"] = title
data["notification[long_message]"] = message
data["notification[sound]"] = sound
data["notification[icon_url]"] = icon
data["notification[source_name]"] = source_name
requests.post(url, data)
return data
def main():
accesstoken = "Find Yours Via boxcar.io"
boxcarnotify(accesstoken, "Testing Notification",
"testing this in python")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment