Created
April 19, 2021 14:26
-
-
Save jpmens/3e7873d3bf3a73b31174c41431af2b6a to your computer and use it in GitHub Desktop.
traccar-paris
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
| #!/usr/bin/env python | |
| import requests | |
| import json | |
| import time | |
| data = { | |
| '_type' : 'location', | |
| 'lat' : 48.85593, | |
| 'lon' : 2.29431, | |
| 'tid' : "owntracks/qtripp/j001", # "JJ", | |
| 'vel' : 109, | |
| 'alt' : 143, | |
| 'tst' : int(time.time()), | |
| } | |
| payload = json.dumps(data) | |
| print(payload) | |
| s = requests.Session() | |
| # s.auth = ( 'user', 'pass' ) | |
| s.headers.update({ | |
| "Content-type" : "application/json" | |
| }) | |
| r = s.post("http://127.0.0.1:5144/", data=payload) | |
| print(r.content) | |
| # time.sleep(5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment