アメブロ旦那観察日記の画像をインスタグラムと同じサイズで表示
// ==UserScript== // @name mofu_ameblo // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://ameblo.jp/mofu-everyday/entry* // @match https://ameblo.jp/mofu-everyday/theme* // @grant GM_addStyle // @grant GM_getResourceText // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js // @require https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js // @resource style https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css // @resource style2 https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.css // ==/UserScript== var style = GM_getResourceText('style'); GM_addStyle(style); var style2 = GM_getResourceText('style2'); GM_addStyle(style2); var result2 = document.evaluate('//div[./a[@href="https://html.co.jp/ha_chu"]]', document, null, 7, null); result2.snapshotItem(0).insertAdjacentHTML('afterbegin', '<input type="button" value="画像のみ表示" id="gazou">'); document.getElementById("gazou").addEventListener('click', sample, false); function sample() { var result = document.evaluate('//div[@class="skin-entryBody"]//a/img', document, null, 7, null); var tmp = []; for (var i = 0; i < result.snapshotLength; i++) { result.snapshotItem(i).src = result.snapshotItem(i).src.replace("?caw=800", "?caw=600"); tmp[i] = result.snapshotItem(i).src; } if (i > 0) { document.body.innerHTML = '<div id="slick-box"></div><div id="count"></div>'; for (i = 0; i < tmp.length; i++) { document.getElementById("slick-box").insertAdjacentHTML('beforeend', '<figure><img src=' + tmp[i] + ' title=' + (i + 1) + '/' + tmp.length + '></figure>'); } $(function () { $('#slick-box').slick(); $('#slick-box').on('afterChange', function (slick, currentSlide) { var current_slide = $('#slick-box').slick('slickCurrentSlide'); $('#count').text((current_slide + 1) + "/" + tmp.length); }); }); } } $(function () { $('.skin-borderQuiet img').hover(function () { $(this).attr('src', $(this).attr('src').replace('?cpd=100', '?cpd=200')); }, function () { if (!$(this).hasClass('currentPage')) { $(this).attr('src', $(this).attr('src').replace('?cpd=200', '?cpd=100')); } }); });
http://scratchpad.io/next-cows-1097
[data-uranus-component="blogGenreEntryRankInfo"] { display: none; } [data-uranus-component="entryHead"], [data-uranus-component="entryBody"] { margin: 0; } .hashtag-module-borderTop, .hashtag-module { margin: 0; padding: 0; } .skin-entryAd { display: none; } #slick-box { width: 660px; margin-left: 3%; } #count { margin-left: 350px; } [data-uranus-component="imageFrame"] a:hover img { width: 200px !important; height: 200px !important; }
Youtubeの履歴ページに何日前に再生した動画か表示
このスクリプトはFirefoxで動作を保証しないものとします
http://let.hatelabo.jp/jigendaddy/let/hJmd56Cuy4Ni.js
// ==UserScript== // @name youtube_history_ago // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.youtube.com/watch?v=* // @match https://www.youtube.com/feed/history // @grant none // @require https://momentjs.com/downloads/moment-with-locales.js // ==/UserScript== //パラメータ削除用関数 function para_del(str) { var s_url = str + "&"; var array_url = s_url.split("&"); s_url = array_url[0]; return s_url; } //登録処理 var result3 = document.evaluate('id("search-form")', document, null, 7, null); if (document.getElementById("mark") == null) { result3.snapshotItem(0).insertAdjacentHTML('afterend', '<input type="button" value="登録" id="mark">'); } var result4 = document.evaluate('id("mark")', document, null, 7, null); result4.snapshotItem(0).addEventListener('click', function () { var d_url = location.href; var s_url = para_del(d_url); if (s_url != "https://www.youtube.com/feed/history") { if (window.confirm("アドレスバーに" + s_url + "から始まる文字列が表示されていますか?\n異なる場合はキャンセルを押してください。\nリロードを行います")) { localStorage.setItem(s_url, moment().format("YYYY-MM-DD")); alert("ローカルストレージにこの動画のキーを登録しました"); } else { location.reload(); } } }); //検索処理と書き出し if (document.getElementById("write") == null) { result3.snapshotItem(0).insertAdjacentHTML('afterend', '<input type="button" value="表示" id="write">'); } var result5 = document.evaluate('id("write")', document, null, 7, null); result5.snapshotItem(0).addEventListener('click', function () { var result = document.evaluate('//div[@id="title-wrapper"]//a[@id="video-title"]', document, null, 7, null); var result2 = document.evaluate('//ytd-video-renderer//div[@id="metadata-line"]', document, null, 7, null); var flag = 0; for (var i = 0; i < result.snapshotLength; i++) { var n_url = result.snapshotItem(i).href; var nr_url = para_del(n_url); if (nr_url in localStorage) { if (flag != 1) { var loop = i + 1; } var to = moment(); var from = moment(localStorage.getItem(nr_url), "YYYY-MM-DD"); if (moment(from).fromNow() != moment().startOf('day').fromNow()) { if (to.diff(from, 'day') == 1) { result2.snapshotItem(i).insertAdjacentHTML("afterbegin", to.diff(from, 'day') + " day ago "); } else { result2.snapshotItem(i).insertAdjacentHTML("afterbegin", to.diff(from, 'day') + " days ago "); } } else { result2.snapshotItem(i).insertAdjacentHTML("afterbegin", "Today "); } flag = 1; } } alert("最後に登録したのは" + loop + "本前に見た動画です"); });
インスタグラムで複数投稿の場合投稿数を表示
このスクリプトはインスタグラムで黒背景の段階を飛ばすgresemonkeyスクリプトと併用することをお勧めします
// ==UserScript== // @name insta_count // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.instagram.com/p/* // @grant none // ==/UserScript== var result = document.evaluate('//div[not(./node())][./following-sibling::div[not(./node())] or ./preceding-sibling::div[not(./node())]]', document, null, 7, null); if (result.snapshotLength > 1) { alert("This post contains " + result.snapshotLength + " photos or videos."); }
インスタグラムでURLリストを作成
http://let.hatelabo.jp/jigendaddy/let/hJmd5b-10_Ne.js
// ==UserScript== // @name insta_url_list // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.instagram.com/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js // ==/UserScript== function k_set() { var d_url = window.prompt("URLを入力してください", ""); var d_title = window.prompt("タイトルを入力してください", ""); if (window.confirm("タイトルは" + d_title + "\nURLは" + d_url + "でよろしいですか?\n一つでも違う場合はキャンセルを押してください")) { for (var i = 0; i < 128; i++) { if (!("v_url" + (i + 1) in localStorage)) { localStorage.setItem("v_url" + (i + 1), "v_" + d_title); localStorage.setItem("v_" + d_title, d_url); var flag = i + 1; break; } } } else { flag = 0; } return flag; } var result = document.evaluate('//nav//a[./button[@type]]', document, null, 7, null); result.snapshotItem(0).insertAdjacentHTML('beforebegin', '<input type="button" value="保存" id="save">'); result.snapshotItem(0).insertAdjacentHTML('beforebegin', '<input type="button" value="開く" id="open">'); result.snapshotItem(0).insertAdjacentHTML('beforebegin', '<input type="button" value="削除" id="remove">'); var result2 = document.evaluate('id("save")', document, null, 7, null); result2.snapshotItem(0).addEventListener('click', function () { var f_lp = 0; f_lp = k_set(); if (f_lp != 0) { if ("v_null" in localStorage || "v_" in localStorage) { alert("登録処理を中断します"); localStorage.removeItem("v_null"); localStorage.removeItem("v_"); localStorage.removeItem("v_url" + f_lp); } else { alert("保存しました"); } } }); var result3 = document.evaluate('id("open")', document, null, 7, null); result3.snapshotItem(0).addEventListener('click', function () { if (document.getElementById("select01") == null) { result2.snapshotItem(0).insertAdjacentHTML("beforebegin", "<select id='select01'><option value='none'>選択してください</option></select>"); } var result5 = document.evaluate('id("select01")', document, null, 7, null); for (var i = 0; i < 128; i++) { if ("v_url" + (i + 1) in localStorage) { var d_title = localStorage.getItem("v_url" + (i + 1)) var d_url = localStorage.getItem(d_title); d_title = d_title.replace("v_", ""); result5.snapshotItem(0).insertAdjacentHTML("beforeend", "<option value='" + d_url + "'>" + d_title + "</option>"); } else { break; } } result5.snapshotItem(0).addEventListener('change', function () { var selectedValue = $("#select01").val(); location.href = selectedValue; }); }); var result4 = document.evaluate('id("remove")', document, null, 7, null); result4.snapshotItem(0).addEventListener('click', function () { for (var j = 0; j < 128; j++) { if (localStorage.getItem("v_url" + (j + 1)) in localStorage) { localStorage.removeItem(localStorage.getItem("v_url" + (j + 1))); localStorage.removeItem("v_url" + (j + 1)); alert("削除しました"); break; } } });
ニュートピ!の情報を削る
// ==UserScript== // @name newtopi_subback // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://newstopics.jp/* // @exclude https://newstopics.jp/url/* // @grant none // ==/UserScript== var result = document.evaluate('//a[@class="title"]', document, null, 7, null); var result2 = document.evaluate('//a[@class="title"]/text()', document, null, 7, null); var result3 = document.evaluate('//span[@class="cnt"]/text()', document, null, 7, null); document.body.innerHTML = ""; for (var i = 0; i < result.snapshotLength; i++) { document.body.insertAdjacentHTML("beforeend", "<a href='" + result.snapshotItem(i).href + "'>" + (i + 1) + ": " + result2.snapshotItem(i).nodeValue + "(" + result3.snapshotItem(i).nodeValue + ")</a><br>"); }
a:link { color: #0000EE; text-decoration: underline; } a:visited { color: #551A8B; text-decoration: underline; } a:active { color: #FF0000; text-decoration: underline; }
インスタグラムで黒背景の段階を飛ばす
// ==UserScript== // @name insta_open_blackout_curtain // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.instagram.com/* // @exclude https://www.instagram.com/p/* // @grant none // ==/UserScript== var result = document.evaluate('//article//a', document, null, 7, null); for (var i = 0; i < result.snapshotLength; i++) { result.snapshotItem(i).addEventListener('click', sample, false); result.snapshotItem(i).dataset.href = result.snapshotItem(i).href; result.snapshotItem(i).href = "javascript:void(0);"; } function sample() { //ダミーの履歴を追加 history.pushState(null, null, "#"); location.href = this.dataset.href; }
Youtube履歴ページで指定したチャンネルの動画を表示
// ==UserScript== // @name youtube_history_abema // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.youtube.com/feed/history // @grant none // ==/UserScript== var result2 = document.evaluate('//input[@id="search"]', document, null, 7, null); result2.snapshotItem(0).addEventListener('change', function () { if (result2.snapshotItem(0).value == "acc") { var sign = window.prompt("検索するチャンネル名を入力してください", "AbemaTV"); var reg = new RegExp(sign); var result = document.evaluate('//ytd-video-renderer[.//yt-formatted-string[@id="byline"]]', document, null, 7, null); var result4 = document.evaluate('//ytd-video-renderer//yt-formatted-string[@id="byline"]', document, null, 7, null); for (var i = 0; i < result.snapshotLength; i++) { if (reg.test(result4.snapshotItem(i).title)) { result.snapshotItem(i).classList.add("kore"); } } var result3 = document.evaluate('//ytd-video-renderer[not(contains(@class,"kore"))]', document, null, 7, null); for (var j = 0; j < result3.snapshotLength; j++) { result3.snapshotItem(j).style.display = 'none'; } } else if (result2.snapshotItem(0).value == "copy") { var result5 = document.evaluate('//ytd-video-renderer[contains(@class,"kore")]//a[@id="video-title"]', document, null, 7, null); var buf = ""; for (var k = 0; k < result5.snapshotLength; k++) { buf = buf + " " + result5.snapshotItem(k).href; } var sign2 = window.prompt("url_list", buf); } });