Skip to content

Instantly share code, notes, and snippets.

Working from canada


Working from canada
Block or report user

Report or block Poolitzer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Poolitzer / gist:db886b1028b7d7a6654df39f03af55cb
Created Feb 6, 2019
This is an example Instantview for the website
View gist:db886b1028b7d7a6654df39f03af55cb
~version: "2.0"
# this IV is a pretty basic example for a pretty basic website. LET'S GO
?exists: //meta[@content="article"]
# very easy way to determine if our IV should be generated or not. Works well.
body: //article
title: $body//h1[1]
channel: "@PresseEifel"
# basic variables, its their official channel, so we set it as well.
author: //a[@rel="author"]
author_url: //a[@class="url fn n"]/@href
import logging
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
def start_command(update, context):
Poolitzer /
Created Oct 21, 2019
An example of how to download bigger files via telethon, coming from ptb
import asyncio
from telegram.ext import Updater, MessageHandler, Filters
from telethon.utils import resolve_bot_file_id, get_input_location
from telethon import TelegramClient
import logging
Poolitzer /
Created Jan 31, 2020
Ever wanted to download something and send it via telegram without having to save it to a file? Fear not!
import io
def downloader(bot, url, timeout=None):
# if you receive a timeout error, pass an increasing timeout until you don't
buf = bot.request.retrieve(url, timeout=timeout)
# turning the byte stream into a file_like object without actually writing it to a file
file_like = io.BytesIO(buf)
# and returning it
return file_like
You can’t perform that action at this time.