Advertisement
Guest User

pushover

a guest
Aug 20th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/usr/bin/python
  2. #
  3. # Change token, user and device. Device can be skipped (notification will be sent to all devices
  4. import httplib, urllib, sys, syslog
  5. syslog.syslog('deluge test: the script started running')
  6.  
  7. if len(sys.argv) != 4:
  8. syslog.syslog("Not 4 input arguments")
  9. sys.exit(0)
  10.  
  11. torrent_name = sys.argv[2]
  12. folder = sys.argv[3]
  13. title = 'Torrent Downloaded'
  14. conn = httplib.HTTPSConnection("api.pushover.net:443")
  15. conn.request("POST", "/1/messages.json",
  16. urllib.urlencode({
  17. "token": "<application_token>",
  18. "user": "<user_token>",
  19. "message": torrent_name,
  20. "title": title,
  21. "device": "<device_name>",
  22. }), { "Content-type": "application/x-www-form-urlencoded" })
  23. conn.getresponse()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement