commit 52f86a367f63772df3266ec55757aefe72a20798 Author: Yannik Schmidt Date: Sun May 23 01:54:59 2021 +0200 Initial diff --git a/getdata.py b/getdata.py new file mode 100755 index 0000000..efc7089 --- /dev/null +++ b/getdata.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +import requests +import argparse +from bs4 import BeautifulSoup + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('URL', help='URL to query') + args = parser.parse_args() + + response = requests.get(args.URL) + b = BeautifulSoup(response.content.decode("UTF-8")) + el = b.find(id="visitorcount-container") + count = el.get("data-value") + postr = requests.post('http://localhost:8086/write?db=collectd', + data="bouldern,ident=zirndorf {}".format(count)) + print(postr.status) + sys.exit(0) +