NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Get VK RegDate // @namespace askja/vk-scripts // @version 0.1 // @description Отображение даты регистрации в вк // @author Askja // @match *://vk.com/* // @icon https://www.google.com/s2/favicons?domain=vk.com // @grant GM.xmlHttpRequest // @grant GM.log // @copyright 2021, Askja (https://openuserjs.org/users/Askja) // @license MIT // ==/UserScript== function request(url, callback) { GM.xmlHttpRequest({ url: url, revalidate: true, async: true, nocache: true, timeout: 5000, onload: function(e) { callback(e); }, onerror: function(e) { GM.log(e); }, method: "GET" }); } function $(element) { return document.querySelector(element); } function create(element) { return document.createElement(element); } function createRow(label, text) { let row = create('div'); row.className = 'clear_fix profile_info_row'; row.innerHTML = '<div class="label fl_l">' + label + '</div><div class="labeled">' + text + '</div>'; return row; } function addLeadingZeroToDate (date) { return ('0' + date).slice(-2); } ! function () { new MutationObserver(function () { let vkProfile, vkId = cur.oid, vkMonthName = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']; if ( !(vkProfile = $('#profile_short:not(.askja-patch)')) || cur.module !== 'profile' ) { return; } vkProfile.className += ' askja-patch'; request('/foaf.php?id=' + vkId, function(response) { let regDate = new Date( (response.responseText.match(/ya:created dc:date="(.+)"/i) || [])[1] ); vkProfile.insertBefore(createRow('Дата регистрации', regDate.getDate() + ' ' + vkMonthName[regDate.getMonth()] + ' ' + regDate.getFullYear() + ' в ' + addLeadingZeroToDate(regDate.getHours()) + ':' + addLeadingZeroToDate(regDate.getMinutes()) + ':' + addLeadingZeroToDate(regDate.getSeconds())), $('.profile_more_info')); }); }).observe($("body"), { childList: !0, subtree: !0 }) }();