Skip to content

Instantly share code, notes, and snippets.

@boring-dragon
Last active December 23, 2020 12:30
Show Gist options
  • Save boring-dragon/226881cfe0bfd38e8e6a8241d35a11eb to your computer and use it in GitHub Desktop.
Save boring-dragon/226881cfe0bfd38e8e6a8241d35a11eb to your computer and use it in GitHub Desktop.
Watch for movie tickets and get telegram notification when its available in cinema.mv. This is something I wrote up an year ago
import requests
import cfscrape
import datetime
import telebot
import time
from bs4 import BeautifulSoup
# Telegram bot token
bot_token = ''
bot = telebot.TeleBot(token=bot_token)
# Telegram channel id
chatid =
def scapp():
try:
scraper = cfscrape.create_scraper()
# Name of the movue
name = "Aladdin"
# Movie link
response = scraper.get("https://cinema.mv/movie/aladdin")
soup = BeautifulSoup(response.text, 'html.parser')
paragraphs = soup.find("p").text
date = datetime.datetime.now()
if(paragraphs == "There are no screenings of this show available"):
message = "Tickets are not available for {1}.. logged: {0}".format(date,name)
print(message)
except AttributeError as error:
date = datetime.datetime.now()
name = "Aladdin"
message = "Tickets are available.. for {1} logged: {0}".format(date, name)
bot.send_message(chatid, message)
#print(message)
def text():
x = 1
while x == 1:
scapp()
time.sleep(120)
text()
@boring-dragon
Copy link
Author

boring-dragon commented Dec 23, 2020

Screenshot of the telegram notification

Capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment