-
-
Save AnOddName/70540cf4e4694c6273f141b926baaa72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("---------") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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