Page 1 of 1

newbie in Python /pushover messaging

Posted: Wednesday 16 August 2017 16:01
by petecz
hello,
I ve got such a problem
viewtopic.php?f=62&t=18865
I am trying to make workaround with Python script
My JSON address is:
http://192.168.101.117:8080/json.htm?ty ... ces&rid=12
my data which are gonna to be extracted is @screenshot.
I want to have a message when state is changed /for example it will be loss of voltage on alarm system.
I have a piece of code for sending pushover notes and it works.

Code: Select all

 
import sys
import json
import urllib2
import re
import time
import datetime
import httplib, urllib
 

conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
    "token": "ap",
    "user": "ug",
    "message": "message: ",
    "title": "title",
    "priority": "-1",
  }), { "Content-type": "application/x-www-form-urlencoded" })
conn.getresponse()

How to merge it?

Re: newbie in Python /pushover messaging

Posted: Wednesday 16 August 2017 17:59
by mivo