/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
send_sms/send_sms.py
24 строки
497 B
gil9red
Refactoring. Using black code style
26 июн 2023, 10:21
26 июн 2023, 10:21
f3ce803
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" """Скрипт, используя сервис http://sms.ru, отправляет смс.""" # Описание API: https://mts.sms.ru/?panel=api&subpanel=method&show=sms/send import requests api_id = "<api_id>" to = "<to>" text = "<text>" url_pattern = "http://sms.ru/sms/send?api_id={api_id}&to={to}&text={text}" rs = requests.get(url_pattern.format(api_id=api_id, to=to, text=text)) print(rs) print(rs.text)