TwitterのTLで指定したユーザーの最新ツイートに移動
http://let.hatelabo.jp/jigendaddy/let/hJmd3o2kls49.js
// ==UserScript== // @name twitter_jump_user // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://twitter.com/* // @grant none // ==/UserScript== var result4 = document.evaluate('id("global-new-tweet-button")', document, null, 7, null); result4.snapshotItem(0).insertAdjacentHTML('afterend', '<input type="button" value="jump_user" id="jump">'); var result5 = document.evaluate('id("jump")', document, null, 7, null); result5.snapshotItem(0).addEventListener('click', sample, false); function sample() { var sign = window.prompt("誰のツイートに飛びますか", "アカウント名の@以下を入力してください"); var result = document.evaluate('//div[@class="stream-item-header"]/descendant::span[contains(@class,"username")][1]/b/text()', document, null, 7, null); var result2 = document.evaluate('//div[@class="stream-item-header"]/descendant::span[contains(@class,"username")][1]', document, null, 7, null); var flag = 0; for (var i = 0; i < result.snapshotLength; i++) { if (result.snapshotItem(i).nodeValue == sign) { result2.snapshotItem(i).id = "hoge"; flag = 1; break; } } if (flag == 1) { var result3 = document.evaluate('id("hoge")/ancestor::li[1]', document, null, 7, null); var l_url = location.href; l_url = l_url.replace(location.hash, ""); location.href = l_url + "#" + result3.snapshotItem(0).id; } else { alert("該当するユーザーのツイートがありません"); } }
videoタグのsrc要素を開く
var result = document.evaluate('//video', document, null, 7, null); window.open(result.snapshotItem(0).src);
キンマweb 熱論!Mリーグ
Twitterで下書きを保存
このスクリプトはFirefoxで動作を保証しないものとします
http://let.hatelabo.jp/jigendaddy/let/hJmd3o2Zm8Q7.js
// ==UserScript== // @name twitter_draft // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://twitter.com/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js // ==/UserScript== var result = document.evaluate('id("global-new-tweet-button")', document, null, 7, null); result.snapshotItem(0).insertAdjacentHTML('afterend', '<input type="button" id="draft" value="下書き">'); document.getElementById("draft").addEventListener('click', function () { localStorage.setItem("n_url", location.href); history.pushState(null, null, "/koko_nanimo_naidesuyo"); document.body.innerHTML = ""; document.body.insertAdjacentHTML("beforeend", "<textarea>戻るボタンなどのブラウザバックで元のページに戻ります</textarea><br><input type='button' value='save'><input type='button' value='load'><span class='count'>0</span>"); var result2 = document.evaluate('//input', document, null, 7, null); result2.snapshotItem(0).addEventListener('click', sample, false); result2.snapshotItem(1).addEventListener('click', sample2, false); function sample() { var result3 = document.evaluate('//textarea', document, null, 7, null); localStorage.setItem('draft', result3.snapshotItem(0).value); } function sample2() { var result3 = document.evaluate('//textarea', document, null, 7, null); var draft = localStorage.getItem('draft'); result3.snapshotItem(0).value = draft; } $('textarea').bind('keydown keyup keypress change', function () { var thisValueLength = $(this).val().length; $('.count').html(thisValueLength + "/140"); }); window.addEventListener('popstate', function (event) { location.href = localStorage.getItem("n_url"); }); });
これまで作成したgreasemonkeyスクリプト
- nishino_ameblo_kdiv 西野ブログで不要な空divを削除
- nishino_ameblo_br 西野ブログで不要な改行を削除
- ameblo_link アメブロの内部リンクをJavaScriptで実行
- nishino_ameblo_easy 西野ブログ実験版
- google_search_blist Google検索でブラックリストを設定
- nishino_ameblo_fbi 西野ブログでフォントを削除
- katsumaweb_ad 勝間和代オフィシャルサイトで広告削除
- save_video_currentime Youtubeで再生中の動画において再生時間を保存する
- youtube_watchtime Youtubeで再生した動画の数を保存して表示
- google_copy_url Googleウェブ検索でURLをまとめてコピー するアイコン設置
- 2nn_sc 2NNで2ch.netのリンクを2ch.scに置き換える
- youtube_skip_button Youtubeで再生中の動画を終わらせる
- nico_skip_button ニコニコ動画の再生前広告を飛ばすアイコン設置
- nico_history_copy ニコニコ動画の履歴ページから動画のURLをコピー
- abema_update_check AbemaTVの更新チェック
- nico_history_ago ニコニコ動画の履歴ページに何日前に再生した動画か表示
- twitter_draft Twitterで下書きを保存する
- twitter_jump_user TwitterのTLでユーザーを指定して最後のツイートに飛ぶ
- abema_url_list AbemaTVでURLリストを作成
- newtopi_link_open_same ニュートピ!のリンクを同じタブで開くボタン設置
- nico_auto_load ニコニコ動画の動画終了時に次の動画に自動的に飛ぶ
- newspicks_save_link NewsPicksで「続きを読む」リンクのURLを保存してコピー
- newtopi_link_exchange ニュートピ!のリンクを入れ替える
- togetter_simple Togetterにコメント欄へ飛ぶリンクを追加
- insta_movie インスタグラムで動画再生時に長さと音量調整スライダーを表示
- newtopi_img2twitter ニュートピ!で画像付きツイートのクリック時に画像のみを表示
- youtube_history_abema Youtube履歴ページで指定したチャンネルの動画を表示
- insta_url_list インスタグラムでURLリストを作成
- insta_count インスタグラムで複数投稿の場合投稿数を表示
- youtube_history_ago Youtubeの履歴ページに何日前に再生した動画か表示
- mofu_ameblo アメブロ旦那観察日記の画像をインスタグラムと同じサイズで表示
- youtube_volume_alert Youtubeで音量調整が必要そうな場合に警告を表示
- twitter_acc_list 登録したTwitterのアカウントを一覧リストで表示
- spot_search SPOTで記事を探しやすくする
- twitter2hatena Twitterのツイートをはてなブログに埋め込む形式でリストを表示
- youtube2hatena YoutubeでURLメモ用のテキストエリアを表示
- twitter_date Twitterで今日の予定をメモ
- twitter_moment_list Twitterで登録したモーメントを一覧リストで表示
- renban_load_zero 画像のみ表示時に連番画像を生成
ニコニコ動画の視聴履歴に何日前に見た動画か記載
http://let.hatelabo.jp/jigendaddy/let/hLHV2dCKgN0j.js
// ==UserScript== // @name nico_history_ago // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.nicovideo.jp/my/history // @grant none // @require http://momentjs.com/downloads/moment.js // ==/UserScript== var result = document.evaluate('//p[@class="posttime"]/text()', document, null, 7, null); var g_time; var d_time = []; for (var i = 0; i < result.snapshotLength; i++) { g_time = result.snapshotItem(i).nodeValue.replace("年", ""); g_time = g_time.replace("月", ""); g_time = g_time.replace("日", ""); g_time = g_time.replace(" 視聴", ""); if (moment(g_time, "YYYYMMDD").fromNow() == moment().startOf('day').fromNow()) { d_time[i] = "今日"; } else { d_time[i] = moment(g_time, "YYYYMMDD").fromNow(); } } for (i = 0; i < d_time.length; i++) { d_time[i] = d_time[i].replace(" ago", "前"); d_time[i] = d_time[i].replace("a day", "1日"); d_time[i] = d_time[i].replace("days", "日"); d_time[i] = d_time[i].replace("a month", "1ヶ月"); d_time[i] = d_time[i].replace("months", "ヶ月"); d_time[i] = d_time[i].replace(" ", ""); } var result2 = document.evaluate('//p[@class="posttime"]/span', document, null, 7, null); for (i = 0; i < d_time.length; i++) { result2.snapshotItem(i).insertAdjacentHTML("beforebegin", "(" + d_time[i] + ")"); }
AbemaTVでページを開くたびに更新があるかチェック
このスクリプトはFirefoxで動作を保証しないものとします
http://let.hatelabo.jp/jigendaddy/let/hLHV2Mz_nPIk.js
// ==UserScript== // @name abema_update_check // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://abema.tv/video/title/* // @grant none // ==/UserScript== var result = document.evaluate('//div[@role="listitem"][.//img]//a[not(.//img)]', document, null, 7, null); var flag = 0; if (!("update_time" in localStorage)) { var now1 = Math.floor((new Date).getTime() / 1000); localStorage.setItem('update_time', now1); localStorage.setItem("check_update", result.snapshotItem(0).href); alert("最終更新動画をチェック対象に設定しました"); } else { var now2 = Math.floor((new Date).getTime() / 1000); var l_update_time = Number(localStorage.getItem('update_time')); if (now2 - l_update_time > 24 * 60 * 60) { for (var i = 0; i < result.snapshotLength; i++) { var n_url = result.snapshotItem(i).href; var l_url = localStorage.getItem('check_update'); if (n_url == l_url) { flag = 1; localStorage.setItem('update_time', now2); if (i == 0) { alert("更新はありません"); break; } else { alert(i + "本の更新があります"); localStorage.setItem('check_update', result.snapshotItem(0).href); break; } } } if (flag == 0) { alert("20本以上の更新があります"); localStorage.setItem('update_time', now2); localStorage.setItem('check_update', result.snapshotItem(0).href); } } /*else { var sec = now2 - l_update_time; alert("前回の更新から" + sec + "秒が経過しています"); localStorage.setItem('update_time', now2); }*/ }