Скрипт достижений в приложении Тюряга ВКонтакте 3.2.1

Скрипт для вывода инфы о игроке в приложении Тюряга на главной страничке юзера ВКонтакте. Ежели ваш друг играет в Тюрягу, скрипт выведет информацию о его игроке прямо у него на страничке. Скрипт указывает кличку в приложении, кол-во авторитета и статистику по убийству шефов.

скрипт достижений в приложении тюряга вконтакте 3.2.1

Cod скрипта:

Cod200?’200px’:»(this. scrollHeight5)’px’);»>// ==UserScript==
// @name prison-club23349009-3.2.1_Pro(Fers)
// @namespace Vk
// @include http://vk. com/*
// @include http://vkontakte. ru/*
// ==/UserScript==

var fidd=4430;var user=GM_getValue(‘user’);var auth_key=GM_getValue(‘auth_key’);if(user!=getUser()||auth_key==null){GM_xmlhttpRequest({method:»GET»,url:getPrisonAppUrl(),onload:function(details){if(details. status==200){var auth_key=details. responseText. match(/\»auth_key\»:\»(.?)\»/)[1];user=getUser();GM_setValue(‘user’,user);GM_setValue(‘auth_key’,auth_key);main();}}});}
function getUser(){return parseInt(document. body. innerHTML. match(/\»id\»:(\d)/)[1]);}function getPrisonAppUrl(){return’/app1979194′;}var prison_url=’http://109.234.155.198/’;function createPrisonSection(profile_short, response){var main_info=createSection(profile_short,’club23349009’);main_info=createSection(profile_short,’Кореш’);main_info. appendChild(createRow(‘Кликуха’,response. name));main_info. appendChild(createRow(‘Авторитет’,response. rating));
main_info. appendChild(createRow(‘Посиживает в хате’,response. background));main_info. appendChild(createRow(‘Длина бороды’,response. beard));var bosses_info=createSection(profile_short,’Количество побед’);for(var i=0;i<response. bosses. length;i){var boss=response. bosses[i];bosses_info. appendChild(createRow(boss. name, boss. winsCount));}var talent_info=createSection(profile_short,’Таланты’);
talent_info. appendChild(createRow(«Вложенных талантов»,response. sumtalents));}function createErrorSection(profile_short, name){var error_info=createSection(profile_short,’Ошибка’);error_info. appendChild(createSectionError(‘Сервер Тюряги не отвечат на запрос :(‘));error_info. appendChild(createSectionError(‘Нажмите «F5″ либо попытайтесь обновить позднее.’));error_info=createSection(profile_short,»);}
function createSectionError(a){var b=document. createElement(«div»);b. style. color=’red’;b. style. fontWeight=’bold’;a=document. createTextNode(a);b. appendChild(a);return b}function createSection(profile_short, name){var h4=document. createElement(‘h4’);h4.style. height=’4px’;var b=document. createElement(‘b’);b. style. paddingLeft=’6px’;b. style. paddingRight=’6px’;b. style. fontSize=’11px’;b. style. backgroundColor=’white’;
var b_value=document. createTextNode(name);b. appendChild(b_value);h4.appendChild(b);var profile_info=document. createElement(‘div’);profile_info. className=’profile_info prsion’;profile_short. appendChild(h4);profile_short. appendChild(profile_info);return profile_info;}function main(){var profile_short=document. getElementById(‘profile_short’);if(profile_short!=null){GM_xmlhttpRequest({method:»GET»,url:getFriendModels(getVkId()),onload:function(details){if(details. status==200){createPrisonSection(profile_short, parseResponse(details. responseText));}else if(details. status==500){createErrorSection(profile_short,»);}}});}}function parseResponse(theString){var response={}
var parser=new DOMParser();var xmlDoc=parser. parseFromString(theString,»text/xml»);var nsResolver=xmlDoc. createNSResolver(xmlDoc. ownerDocument==null? xmlDoc. documentElement:xmlDoc. ownerDocument. documentElement);var ratings=xmlDoc. evaluate(‘//rating’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);response. rating=ratings. iterateNext().textContent;var names=xmlDoc. evaluate(‘//name’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);response. name=Url. decode(names. iterateNext().textContent);
var backgrounds=xmlDoc. evaluate(‘//background’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);response. background=formatHata(backgrounds. iterateNext().textContent);var beards=xmlDoc. evaluate(‘//beard’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);response. beard=dlboroda(beards. iterateNext().textContent);var bosses=xmlDoc. evaluate(‘//boss’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);
var boss=bosses. iterateNext();response. bosses=[];while(boss){response. bosses. push(formatBoss(parseInt(boss. getAttribute(‘id’)),parseInt(boss. textContent)));boss=bosses. iterateNext();}var playerTalents=xmlDoc. evaluate(‘//talent’,xmlDoc, nsResolver, XPathResult. ANY_TYPE, null);var talent=playerTalents. iterateNext();response. sumtalents=0;while(talent){response. sumtalents=parseInt(talent. textContent);talent=playerTalents. iterateNext();}return response;}function formatBoss(id, count){var bossNames=[’Кирпич’,’Сизый’,’Махно’,’Свирепый’,’Шайба’,’Палыч’,’Цыклоп’,’Бес’,’Паленый’,’Борзов’];var boss={}
boss. name=bossNames[id-1];boss. winsCount=(vkId==fId? count1:count);return boss;}function formatHata(id){var hata=’Рядовая’;if(id==1){hata=’Кирпича’;}else if(id==2){hata=’Махно’;}else if(id==3){hata=’Свирепого’;}else if(id==4){hata=’Шайбы’;}else if(id==5){hata=’Палёного’;}else if(id==6){hata=’Борзого’;}return hata;}function dlboroda(id){var boroda='(0)побрит’;if(id==1){boroda='(1)щетина’;}else if(id==2){boroda='(2)бородка’;}else if(id==3){boroda='(3)средняя’;}else if(id==4){boroda='(4)зарос’;}else if(id==5){boroda='(5)чушкарь’;}
return boroda;}var vkId=getVkId();function getVkId(){var id=document. body. innerHTML. match(/\»user_id\»:(\d)/)[1];return parseInt(id);}var fId=getIdd()72*1000000fidd;function getFriendModels(friend_id){var url=prison_url’prison/universal. php? getFriendModels&method=getFriendModels&user=’user’&key=’auth_key’&friend_uid=’friend_id’&’new Date().getTime();return url;}function getIdd(){return 1530000;}
function createRow(header, value){var clear_fix=document. createElement(‘div’);clear_fix. className=’clear_fix’;var label_fl_l=document. createElement(‘div’);label_fl_l. className=’label fl_l’;var label_fl_l_value=document. createTextNode(header’:’);var labeled_fl_l=document. createElement(‘div’);labeled_fl_l. className=’labeled fl_l’;var labeled_fl_l_value=document. createTextNode(»value);clear_fix. appendChild(label_fl_l);
clear_fix. appendChild(labeled_fl_l);label_fl_l. appendChild(label_fl_l_value);labeled_fl_l. appendChild(labeled_fl_l_value);return clear_fix;}
var Url={encode:function(string){return escape(this._utf8_encode(string));},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){string=string. replace(/\r\n/g,»\n»);var utftext=»»;for(var n=0;n<string. length;n){var c=string. charCodeAt(n);if(c<128){utftext=String. fromCharCode(c);}
else if((c>127)&&(c<2048))192);utftext=String. fromCharCode((c&63)else128);utftext=String. fromCharCode((c&63)}
return utftext;},_utf8_decode:function(utftext){var string=»»;var i=0;var c=c1=c2=0;while(i<utftext. length){c=utftext. charCodeAt(i);if(c<128){string=String. fromCharCode(c);i;}
else if((c>191)&&(c<224))(c2&63));i=2;elsec2=utftext. charCodeAt(i1);c3=utftext. charCodeAt(i2);string=String. fromCharCode(((c&15)<<12)}
return string;}}
main(); Для вас приглянулся материал? 20

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *