Skip to content

Instantly share code, notes, and snippets.

@mikoim
Created December 24, 2023 17:15
Show Gist options
  • Save mikoim/21417362134b5c91046e351a7074664a to your computer and use it in GitHub Desktop.
Save mikoim/21417362134b5c91046e351a7074664a to your computer and use it in GitHub Desktop.
卒業したwithのスクリプト群 足あとフィルター(年齢・住所), プロフィール文を選択可能にする
// ==UserScript==
// @name with 足あとフィルター
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://with.is/mypages/footprints
// @match https://with.is/mypages/footprints?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=with.is
// @grant none
// ==/UserScript==
(function() {
'use strict';
if ((new URL(location.href)).search.includes("page=")) {
location.href = "https://with.is/mypages/footprints";
}
let css = `
`;
let style = document.createElement('style');
style.innerHTML = css;
document.head.append(style);
(new MutationObserver(check)).observe(document, {childList: true, subtree: true});
function check(changes, observer) {
deleteElement("footprint-route_balloon");
deleteElement("notifications_date");
filterUser();
}
function filterUser(){
for (const elem of document.getElementsByClassName("user-area")) {
if(!isTarget(elem)) {
elem.remove();}
}}
function deleteElement(className) {
for (const elem of document.getElementsByClassName(className)) {
elem.remove();
}
}
function isTarget(element) {
const [_, name, ageText, pre, __] = element.getElementsByClassName("footprint_characteristic-info")[0].textContent.split("\n");
const age = Number(ageText.replace("歳", ""));
return age <= 30 && !["東京","茨木", "千葉", "埼玉"].includes(pre);
}
})();
// ==UserScript==
// @name with 選択可能な文字列
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://with.is/users/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=with.is
// @grant none
// ==/UserScript==
(function() {
'use strict';
if ((new URL(location.href)).search.includes("page=")) {
location.href = "https://with.is/mypages/footprints";
}
let css = `
*,*:before,*:after {
user-select: auto;
}
`;
let style = document.createElement('style');
style.innerHTML = css;
document.head.append(style);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment