Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import vk_api
- from bs4 import BeautifulSoup
- import requests
- import time
- print("Создано x11repo\n\nМои контакты:\nTelegram: https://teleg.run/alxxxnd\n")
- token = "" # Сюда вставляем токен
- country = "it" # Страны: ru - РОССИЯ, cn - КИТАЙ, en - США, it - ИТАЛИЯ
- change_country = 60 # ВРЕМЯ В СЕКУНДАХ ЗА КОТОРОЕ 'Весь Мир' сменится на страну которую вы указали в country #НЕ СТАВИТЬ МЕНЬШЕ 60 СЕКУНД!!!
- def coronavirus_info():
- HEADERS = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"}
- session = requests.Session()
- text = session.get("https://news.google.com/covid19/map?hl=ru&gl=RU&ceid=RU:ru", headers=HEADERS).content
- bs = BeautifulSoup(text, "html.parser")
- all = bs.find_all("td", class_="l3HOY")
- return all[1], all[3], all[4], all[86], all[88], all[89], all[31], all[33], all[34], all[6], all[8], all[9], all[16],all[18], all[19]
- def main():
- vk_session = vk_api.VkApi(token=token)
- vk = vk_session.get_api()
- vk.status.set(text="Весь Мир: Всего заболевших: " + str(info[0].text) + ". Выздоровело: " + str(
- info[1].text) + ". Летальные исходы: " + str(info[2].text) + ". Время: " + time.strftime("%H:%M"))
- time.sleep(change_country)
- if country == "ru":
- vk.status.set(text="Россия: Всего заболевших: " + str(info[3].text) + ". Выздоровело: " + str(
- info[4].text) + ". Летальные исходы: " + str(info[5].text) + ". Время: " + time.strftime(
- "%H:%M"))
- elif country == "cn":
- vk.status.set(text="Китай: Всего заболевших: " + str(info[6].text) + ". Выздоровело: " + str(
- info[7].text) + ". Летальные исходы: " + str(info[8].text) + ". Время: " + time.strftime("%H:%M"))
- elif country == "en":
- vk.status.set(text="США: Всего заболевших: " + str(info[9].text) + ". Выздоровело: " + str(
- info[10].text) + ". Летальные исходы: " + str(info[11].text) + ". Время: " + time.strftime(
- "%H:%M"))
- elif country == "it":
- vk.status.set(text="Италия: Всего заболевших: " + str(info[12].text) + ". Выздоровело: " + str(
- info[13].text) + ". Летальные исходы: " + str(info[14].text) + ". Время: " + time.strftime(
- "%H:%M"))
- else:
- pass
- time.sleep(change_country)
- while True:
- try:
- info = coronavirus_info()
- main()
- except:
- print("Ошибка!\nОтпишите мне по контактам для того чтобы я пофиксил!")
Advertisement
Add Comment
Please, Sign In to add comment