feat: bootstrap clickthrough server, skill docs, and syntax CI
All checks were successful
python-syntax / syntax-check (push) Successful in 29s
All checks were successful
python-syntax / syntax-check (push) Successful in 29s
This commit is contained in:
31
examples/quickstart.py
Normal file
31
examples/quickstart.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
BASE_URL = os.getenv("CLICKTHROUGH_URL", "http://127.0.0.1:8123")
|
||||
TOKEN = os.getenv("CLICKTHROUGH_TOKEN", "")
|
||||
|
||||
headers = {}
|
||||
if TOKEN:
|
||||
headers["x-clickthrough-token"] = TOKEN
|
||||
|
||||
|
||||
def main():
|
||||
r = requests.get(f"{BASE_URL}/health", headers=headers, timeout=10)
|
||||
r.raise_for_status()
|
||||
print("health:", r.json())
|
||||
|
||||
s = requests.get(
|
||||
f"{BASE_URL}/screen",
|
||||
headers=headers,
|
||||
params={"with_grid": True, "grid_rows": 12, "grid_cols": 12},
|
||||
timeout=30,
|
||||
)
|
||||
s.raise_for_status()
|
||||
payload = s.json()
|
||||
print("screen meta:", payload.get("meta", {}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user