Get post by slug

This commit is contained in:
simonwt 2026-03-31 10:19:32 +01:00
parent 5516568521
commit 8e8de42d15
4 changed files with 21 additions and 2 deletions

View file

@ -7,6 +7,8 @@ import os, simplejson as json
# Handle environment variables
from dotenv import load_dotenv
load_dotenv()
if not os.getenv("client_id") or not os.getenv("client_secret"):
raise Exception("Please set client_id and client_secret in your environment variables.")
# Initialize API client with credentials from environment variables
API = APIClient(
@ -33,4 +35,7 @@ profile = API.run_job('userprofile.get', "simon-little")
print(profile)
print("-----------------------------")
branch = API.run_job('branch.get', "music")
print(branch)
print(branch)
print("-----------------------------")
post = API.run_job('post.get', "1774875037-170a46a9")
print(post)