Skip to content

Instantly share code, notes, and snippets.

@AnOddName
Created October 2, 2019 03:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AnOddName/70540cf4e4694c6273f141b926baaa72 to your computer and use it in GitHub Desktop.
Save AnOddName/70540cf4e4694c6273f141b926baaa72 to your computer and use it in GitHub Desktop.
client_id = hidden_client_id()
import requests
auth = requests.post("https://id.twitch.tv/oauth2/token", headers={'Client-ID':client_id},data={"client_secret":"xxx","grant_type":"client_credentials"})
r = requests.post("https://api.twitch.tv/helix/webhooks/hub", headers={'Client-ID': client_id}, data={"hub.callback": "http://xxx.ngrok.io/","hub.mode":"subscribe",'hub.topic':"https://api.twitch.tv/helix/streams?user_id=xxx","hub.lease_seconds":600})
webhookcheck = requests.get("https://api.twitch.tv/helix/webhooks/subscriptions?", headers={"Authorization": "Bearer xxx"}, data={"first":"10"})
print(auth.content)
print("---------")
print(r.content)
print("---------")
print(webhook.content)
print("---------")
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['GET','POST'])
def result():
#print(request.data) # should display 'bar'
#print(request.json) # should display 'bar'
return 'Received !' # response to your request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment