<form action="https://api.vk.com/method/messages.send" method="GET" target="frameresult">
<input type="hidden" name="chat_id" value="2">
<input type="hidden" name="v" value="5.80">
<input type="hidden" name="access_token" value="ТОКЕН ГРУППЫ">
<label for="message">Сообщение:</label><br>
<textarea name="message" id="message" style="max-width:300px; max-height:200px;"></textarea>
<div style="text-align:center;">
<button type="submit">Отправить</button>
</div>
</form>
<iframe name="frameresult"></iframe>
function fallbackCopyTextToClipboard(text) {
var textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position="fixed"; //avoid scrolling to bottom
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Fallback: Copying text command was ' + msg);
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
}
document.body.removeChild(textArea);
}
function copyTextToClipboard(text) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text);
return;
}
navigator.clipboard.writeText(text).then(function() {
console.log('Async: Copying to clipboard was successful!');
}, function(err) {
console.error('Async: Could not copy text: ', err);
});
}
copyTextToClipboard( "Твой текст" );
pip install --user requests
в командной строке cmd (он же терминал, она же консоль)import requests, urllib.parse, json, re
s = requests.session()
ua = r"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
s.headers = {"User-Agent": ua}
url = 'https://money.yandex.ru/'
login = 'vasya-ivanov'
password = 'secret'
resp = s.get(url, allow_redirects = True).content.decode("utf8")
if not "balance-widget__amount" in resp:
authurl = "https://passport.yandex.ru/auth?origin=money&retpath=https%3A%2F%2Fmoney.yandex.ru%2F"
resp = s.get(authurl, allow_redirects = True).content.decode("utf8")
token = re.search(r'data-csrf="([^"]+)"', resp).group(1)
resp = s.post(authurl, headers = {
"Referer":authurl
}, data = {
"retpath":url,
"fretpath":"",
"clean":"",
"service":"",
"origin":"",
"policy":"",
"is_pdd":"",
"csrf_token": token,
"login":login,
"hidden-password":password,
"passwd":password,
"twoweeks":"no"
}, allow_redirects = True).content.decode("utf8")
resp = s.get(url, allow_redirects = True).content.decode("utf8")
r = re.search(r'<div class="balance-widget__amount">.*?>([\d]+)<.*?>([\d]+)<', resp)
balance = float(r.group(1)+"."+r.group(2))
price_label = re.search(r'<span.*?price__label.*?">([^<]+)</span>', resp).group(1)
print("Я спарсил баланс!", balance, price_label)
Клиент обязан иметь timeout ответа от сервера не менее 60 секунд для всех API вызовов,
если в описании конкретного REST метода данный параметр не уточняется отдельно.
Установлен
запрет на количество запросов с одного ip адреса
-
не чаще чем 2 раза за 1
минуту
.
$proxy_ip = '12.34.21.23:9050'; //IP адрес сервера прокси и порт
$loginpassw = 'login:password'; //логин и пароль для прокси
$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_ip );
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);
//доступные значения для типа используемого прокси-сервера: CURLPROXY_HTTP (по умолчанию), CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A или CURLPROXY_SOCKS5_HOSTNAME.
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);