View difference between Paste ID: tfhaAC23 and sAKeNZbg
SHOW: | | - or go back to the newest paste.
1
import requests
2
import wykop
3
import time 
4
api=wykop.WykopAPI( "klucz" ,  "sekret")
5
while True:
6
    on=api.tag("lampon")["items"][0]["date"]
7
    off=api.tag("lampoff")["items"][0]["date"]
8
    if on>off :
9
        print "on"
10
        requests.get("http://login:haslo@locla-ip/outs.cgi?out2=0")
11
    else:
12
        requests.get("http://login:haslo@locla-ip/outs.cgi?out2=1")
13
        print "off"
14
    time.sleep(10)
15
#autor wytrzeszcz 
16
# https://github.com/p1c2u/wykop-sdk/blob/88ee190d4a572c0e60d4fea998c034d99b6b7761/README.rst
17
# http://lankontroler.pl/pliki/listwa/man-ip-socket-pl.pdf