Skip to content

Instantly share code, notes, and snippets.

'use strict'
const http = require('http');
const qs = require('querystring');
const TextDecoder = require('text-encoding').TextDecoder;
const PORT = 3000;
// const VK_UID = 50595075;
const VK_REMIXSID = '00796e02caae56926fcd0881bd3b80711c520ad2cf533e0c32522'; // you must be logined to get this
function getPublics(userId,callback) {
var xhr = new XMLHttpRequest();
var body = 'act=load_idols&al=1&oid=' + userId;
xhr.open("POST", 'https://vk.com/al_fans.php', true)
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
function getPublics(userId,callback) {
var xhr = new XMLHttpRequest();
var body = 'act=load_idols&al=1&oid=' + userId;
xhr.open("POST", 'https://vk.com/al_fans.php', true)
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var xhr = new XMLHttpRequest();
var body = 'act=load_idols&al=1&oid=50595075';
xhr.open("POST", 'https://vk.com/al_fans.php', true)
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText)
'use strict'
const http = require('http');
const querystring = require('querystring');
const PORT = 80;
http.createServer((servReq, servRes) => {
const postData = querystring.stringify({
function xhr(xhrMethodName, appendedFunc) {
(function(xhrMethod) {
XMLHttpRequest.prototype[xhrMethodName] = function(data) {
appendedFunc(data);
xhrMethod.call(this.data);
};
})(XMLHttpRequest.prototype[xhrMethodName]);
}
// xhr('send', function(d) {console.log(d)});
self.addEventListener('message', function(e) {
self.postMessage(e.data);
}, false);
var INVITER = {
//chas: '53a8d957e483483cf5', // unique for specific account //lkleonov
chas: 'e796d178a8fd0c3cfb', // unique for specific account //laukye
message: 'Хей, привет! Меня зовут Алексей. В рамках проекта по объединению креативных людей Constellation, мы запустили кампанию по поиску единомышленников. Мы решили, что если ты вдруг тоже заинтересован в поисках оных, то у меня есть для тебя хорошая новость! Попутно мы можем помочь с поисками единомышленников тебе, если ты в них нуждаешься!\n\nРаботает это так: ставишь тег #constellate на стене (или где-нибудь, чтобы тебя можно было найти через поиск) и рядом теги твоих увлечений, в чём ты, может, разбираешься, можешь свободно обсуждать и делиться опытом, творить что-то (ну, например, вот так: "#art #photography #dogbreeding #webdev #handmade #constellate"). И люди смогут потом находить по тегу #constellate тех, кто тоже находится в поисках и видеть, чем они увлекаются, чтобы завязать общение. Или, чтобы дать своим друзьям понять, о чём речь, можешь
'use strict'
const http = require('http');
const querystring = require('querystring');
const VK = {
'groupId': {
name: 'groups.getById',
group_ids: 'boroda.land'
}
@lkLeonov
lkLeonov / instaGet
Created July 28, 2016 17:52
How to get media from instagram via XHR
function getMedia(instaData, mediaCount, callback) {
var profileData = instaData.entry_data.ProfilePage[0];
var userID = profileData.user.id;
var totalMedia = profileData.user.media.count;
var mediaCount = mediaCount > totalMedia ? totalMedia : mediaCount;
var csrf_token = instaData.config.csrf_token;
var xhrBody = "ig_user(" + userID + ") { media.after(0, " + mediaCount + ") {nodes {display_src }}}";
var xhr = new XMLHttpRequest();
xhr.open("POST", '/query/', true)