Skip to content

Instantly share code, notes, and snippets.

@phith0n
Last active September 3, 2024 16:14
Show Gist options
  • Save phith0n/4924a9d3258bc9cd604c52692809e943 to your computer and use it in GitHub Desktop.
Save phith0n/4924a9d3258bc9cd604c52692809e943 to your computer and use it in GitHub Desktop.
CoNote client example
import requests
import sseclient
url = 'https://note.leavesongs.com/api/events'
headers = {'Accept': 'text/event-stream', 'Authorization': 'Token <your API token>'}
response = requests.get(url, headers=headers, stream=True)
client = sseclient.SSEClient(response)
for event in client.events():
print("New %s event: %s" % (event.event, event.data))
requests
sseclient-py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment