-
Notifications
You must be signed in to change notification settings - Fork 0
/
namelen.py
29 lines (21 loc) · 950 Bytes
/
namelen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json, requests
from telegram import Bot
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater
bottoken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
BOT = Bot(token=bottoken)
UPDATER = Updater(bot=BOT, use_context=True)
TG_ADMIN = "xxxxxxxxxxxxxxxxxxxxxx"
bl = []
def check_names(url):
geturl = requests.get(url)
getjson = json.loads(geturl.text)
for jsn in getjson:
if len(jsn["name"]) > 15:
bl.append(jsn["name"])
check_names('https://raw.githubusercontent.com/PixelExperience/official_devices/master/team/maintainers.json')
check_names('https://raw.githubusercontent.com/PixelExperience/official_devices/master/team/core.json')
message = "The following users have names bigger than 15 characters \n\n"
for b in bl:
message = message + b + '\n'
UPDATER.bot.send_message(chat_id=TG_ADMIN, text=message, parse_mode='HTML', disable_web_page_preview='yes')