This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const url = require('url'); | |
| const http = require('http'); | |
| function getBody(req, res) { | |
| return new Promise(function inPromise(resolve, reject) { | |
| if (req.method !== "POST") { | |
| resolve(); | |
| } | |
| res.body = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {createHmac} = require('crypto'); | |
| const querystring = require('querystring'); | |
| const sha256 = (string, pwd) => createHmac('sha256', pwd).update(string).digest('base64'); | |
| function checkSign(url, clientSecret) { | |
| const parsedSearch = querystring.parse(url); | |
| const checkSumRaw = Object | |
| .keys(parsedSearch) | |
| .filter((key) => /^vk_/.test(key)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const https = require('https'); | |
| const fs = require('fs'); | |
| const { spawn } = require('child_process'); | |
| const { Image, createCanvas } = require('canvas'); | |
| const VK = require('VK-Promise'); | |
| const canvas = new createCanvas(1280, 720); | |
| const streamer = VK(""); // https://vk.cc/6njXbx | |
| const request = streamer.request; | |
| const ctx = canvas.getContext('2d'); | |
| const fps = 30; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { PanelHeader, HeaderButton } from '@vkontakte/vkui'; | |
| import Icon24Fullscreen from '@vkontakte/icons/dist/24/fullscreen'; | |
| import Icon24FullscreenExit from '@vkontakte/icons/dist/24/fullscreen_exit'; | |
| class PanelHeaderInternal extends PanelHeader { | |
| get webviewType () { | |
| return window.isWeb ? 'internal' : 'vkapps'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var request = require('request-promise'); | |
| var Events = require('events'); | |
| var emitter = new Events(); | |
| var endpoint = 'https://t.me/spbmetro/'; | |
| var last_mid = 2288; | |
| var pending = 0; | |
| function parseMessage(id) { | |
| return request(endpoint + id).then((res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { spawn } = require('child_process'); | |
| const https = require('https'); | |
| const info = { | |
| lastPending: false, | |
| lastDataDate: 0, | |
| lastLineDate: 0, | |
| lastPushDate: 0, | |
| cpErrors: '\n', | |
| buffer: '', | |
| ipInfo: [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Запрашиваем библиотеку | |
| var VK = require('vk-call').VK; | |
| // Указываем access_token (ключ доступа) | |
| var token = '541a0b8dec33a2098882...4392ccbbd962cf'; | |
| // Версию API | |
| var version = '5.92'; | |
| // Создаем объект для работы с api используя данные выше |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cache = {}, | |
| tts_key = "** yandex.tts.key **", | |
| loading = {}; | |
| function voice2text(key, msg) { | |
| if (utils.isExist(msg, "fwd_messages.0.attachments.0.doc.preview.audio_msg")) return voice2text(msg.fwd_messages[0]).then(msg); | |
| if (!utils.isExist(msg, "attachments.0.doc.preview.audio_msg")) return Promise.resolve(msg); | |
| var doc_id = msg.attachments[0].doc.id; | |
| if (loading[doc_id]) { | |
| return new Promise((resolve) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // rgb2lab + deltaE | |
| // https://github.com/antimatter15/rgb-lab/blob/master/color.js | |
| function deltaRGB(a, b) { | |
| return deltaE(rgb2lab(a), rgb2lab(b)); | |
| } | |
| function FloodFill(imageData, sx, sy, color, delta) { | |
| var xy2i = (x, y) => (y * imageData.width + x) * 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name VK editor | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.2 | |
| // @description Пример скрипта изменяющего функции и запросы vk.com! | |
| // @author Flyink13 | |
| // @match https://vk.com/* | |
| // @grant none | |
| // ==/UserScript== |