Files
@ d8371901f34c
Branch filter:
Location: C3L-NOC/spaceapi/client.py - annotation
d8371901f34c
1.5 KiB
text/x-python
Added new tweets and added lat and lon to tweets
16160deb284a 16160deb284a 16160deb284a 16160deb284a 16160deb284a 16160deb284a 3b479be37a73 3b479be37a73 16160deb284a 16160deb284a 7870fa269c43 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 16160deb284a 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 7870fa269c43 16160deb284a 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 3b479be37a73 | import requests
import json
import time
from requests.auth import HTTPDigestAuth
base_url = 'http://spaceapi.c3l.lu'
auth = HTTPDigestAuth('spaceapi', 'eiCh8bee')
# print("Testing setting state to closed")
payload = {"value": False}
r = requests.post(base_url + '/state/set/open',
auth=auth,
data=json.dumps(payload))
print(r.text)
#
# time.sleep(1)
#
# print("Testing setting message")
# payload = {"value": "Test message"}
# auth = HTTPDigestAuth('test', 'test')
#
# r = requests.post(base_url + '/state/set/message', auth=auth,
# data=json.dumps(payload))
# print(r.text)
# time.sleep(1)
#
# print("Testing setting trigger person")
# payload = {"value": "metalgamer"}
# auth = HTTPDigestAuth('test', 'test')
#
# r = requests.post(base_url + '/state/set/trigger_person',
# auth=auth,
# data=json.dumps(payload))
# print(r.text)
# time.sleep(1)
# print("Testing setting active members")
# payload = {"name": "Active members", "value": 24}
# auth = HTTPDigestAuth('test', 'test')
#
# r = requests.post(base_url + '/sensors/set/total_member_count',
# auth=auth,
# data=json.dumps(payload))
# print(r.text)
# print("Testing setting temperature")
# payload = {"name": "Test", "location": "Test", "unit": "°C", "value": 24}
# auth = HTTPDigestAuth('test', 'test')
#
# r = requests.post(base_url + '/sensors/set/temperature',
# auth=auth,
# data=json.dumps(payload))
# print(r.text)
|