This file contains hidden or 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 asyncio import run | |
from pyrogram import Client, filters, idle | |
from config import API_ID, API_HASH, BOT_TOKEN | |
client = Client( | |
":memory:", | |
api_id=API_ID, | |
api_hash=API_HASH, | |
bot_token=BOT_TOKEN | |
) # State API_ID, API_HASH & BOT_TAKEN in config.py |
This file contains hidden or 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
const request = new XMLHttpRequest(); | |
request.open('GET', 'https://example.com/api/data', true); | |
request.onload = function() { | |
if (this.status >= 200 && this.status < 400) { | |
// Success! | |
const data = JSON.parse(this.response); | |
console.log(data); | |
} else { | |
// We reached our target server, but it returned an error |