Created
          February 27, 2014 17:48 
        
      - 
      
- 
        Save vmitchell85/9255191 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | import httplib, urllib, sys | |
| apiKey = sys.argv[1] | |
| userKey = sys.argv[2] | |
| priority = sys.argv[3] | |
| title = sys.argv[4] | |
| msg = '' | |
| for count, arg in enumerate(sys.argv): | |
| if count > 4: | |
| msg += arg + '\n' | |
| conn = httplib.HTTPSConnection("api.pushover.net:443") | |
| conn.request("POST", "/1/messages.json", | |
| urllib.urlencode({ | |
| "token": apiKey, | |
| "user": userKey, | |
| "message": msg, | |
| "title": title, | |
| "priority": priority, | |
| "retry":"30", | |
| "expire":"3600" | |
| }), | |
| { "Content-type": "application/x-www-form-urlencoded" }) | |
| response = conn.getresponse() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment