Skip to content

Instantly share code, notes, and snippets.

@0mg
Last active August 29, 2015 14:01
Show Gist options
  • Save 0mg/b96a4d0b251ad29b300c to your computer and use it in GitHub Desktop.
Save 0mg/b96a4d0b251ad29b300c to your computer and use it in GitHub Desktop.
nicovideo mylist
// ==UserScript==
// @include http://www.nicovideo.jp/my/mylist/*
// ==/UserScript==
addEventListener("DOMContentLoaded", function() {
var boxid = "MarkdownBox";
if (document.querySelector("#" + boxid)) return;
var dst = document.querySelector("#footerWrap");
var box = document.createElement("textarea");
var btn = document.createElement("input");
btn.type = "button";
btn.value = "mylist";
btn.addEventListener("click", function() {
var videos = document.querySelectorAll(".mylistVideo>h5>a");
var md = "";
[].forEach.call(videos, function(e) {
var url = e.href.replace(/[?].+/, "");
var txt = "* [" + e.textContent + "](" + url + ")\n";
md += txt;
});
box.value = md;
});
box.id = boxid;
box.cols = 100;
box.rows = 15;
dst.appendChild(box);
dst.appendChild(btn);
});

新しいマイリスト

レスリングシリーズ

音楽

ゲーム

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment