您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name オンライン欄増殖 // @namespace http://tampermonkey.net/ // @version 0.6 // @description try to take over the world! // @author You // @match *.x-feeder.info/*/ // @exclude *.x-feeder.info/*/sp* // @exclude *.x-feeder.info/*/settings/** // @require https://greasyfork.org/scripts/396472-yaju1919/code/yaju1919.js?version=802405 // @require https://greasyfork.org/scripts/388005-managed-extensions/code/Managed_Extensions.js?version=720959 // @grant GM.setValue // @grant GM.getValue // @grant GM.xmlHttpRequest // @grant GM.cookie // ==/UserScript== (function() { 'use strict'; const deleteSid = () => GM.cookie.delete({ name:'sid'}); const setSid = s => { GM.cookie.set({ hostOnly: true, httpOnly: true, name: "sid", path: location.pathname, value: s }); }; const setName = s => { GM.cookie.set({ hostOnly: true, name: "name", path: location.pathname, value: s }); }; var h_input, input_bool, input_time, r2, input_now; win.Managed_Extensions["オンライン欄増殖"] = { config: ()=>{ const h = $("<div>"); h_input = $("<div>").appendTo(h); input_time = yaju1919.addInputNumber(h_input,{ title: "リクエスト間隔[秒]", max: 10, min: 0, value: 0.3, save: "wait" }); h.append("<br>"); yaju1919.addInputText(h,{ title: "名前", change: function(v){ if(v) setName(v); } }); h.append("<br>"); input_now = yaju1919.addInputText(h,{ placeholder: "今なにしてる?", save: "now" }); h.append("<br>"); /*yaju1919.addInputBool(h,{ title: "オンライン欄更新停止", // 自分が重くなるのを防ぐ change: function(v){ if(v) { r2 = unsafeWindow.refreshOnlineUsersView; unsafeWindow.refreshOnlineUsersView = () => {}; } else { if(r2){ unsafeWindow.refreshOnlineUsersView = r2; } } } }); h.append("<br>");*/ h.append("<br>"); input_bool = yaju1919.addInputBool(h,{ title: "run", change: function(v){ if(v) main(); } }); return h; }, }; const main = () => { deleteSid(); GM.xmlHttpRequest({ method: "GET", url: location.href, onload: r => { if(!input_bool()) return; var hds = r.responseHeaders; var m = hds.match(/sid/); if(!m) return console.error("sidが見つかりませんでした。"); // sidが無い var sid = hds.slice(m.index + 4).match(/[0-9a-zA-Z]+/)[0]; setSid(sid); //--- syncMyStatus $.post(location.pathname + 'update_status.php', { 'is_mobile': 0, 'status': 0, 'status_text': input_now(), 'now_broadcasting': 0 }); //--- setTimeout(main, input_time() * 1000); }, }); }; })();