Created
January 10, 2010 12:54
-
-
Save teramako/273488 to your computer and use it in GitHub Desktop.
Tumblrダッシュボードの各エントリに公開URLをつけるUserScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name tumblrDashboardSetPublicLink | |
// @namespace http://d.hatena.ne.jp/teramako/ | |
// @include http://www.tumblr.com/dashboard | |
// @include http://www.tumblr.com/tagged/* | |
// @author teramako | |
// @license MIT | |
// ==/UserScript== | |
let postLength = "post".length; | |
function createLink(li) { | |
let url = li.querySelector("img.permalink").parentNode.href, | |
a = document.createElement("a"); | |
a.setAttribute("href", url); | |
a.appendChild(document.createTextNode("permalink")); | |
li.querySelector("div.post_controls").appendChild(a); | |
} | |
Array.slice(document.querySelectorAll("li.post"), 1).forEach(createLink); | |
// vim sw=2 ts=2 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment