Foto2Haiku
-
/*
* @title Foto2Haiku
* @description Post image to HaikuJP with Fotolife Syntax (Forked from fotolife_bookmarklet_v3-2 by Tensor)
* @include http://f.hatena.ne.jp/*
* @include http://f.hatena.com/*
* @license MIT License
* @see http://let.hatelabo.jp/Tensor/let/gYC-xeX1pt_0Xg (Fork of)
* @see http://d.hatena.ne.jp/Tensor/20120508/1336452125
*/
// # Changes
// - allow Hatena World (.com)
// - window.open() -> location.href :for popup-blocker
// If you non support old browsers (ex. IE < 8), more better use of document.QuerySelector('#breadcrumbs input[value]')
// https://developer.mozilla.org/Ja/DOM/Document.querySelector
(function () {
if (typeof Ten !== 'object') return;
if (/^http:\/\/f\.hatena\.(?:ne\.jp|com)\/[\w-]+\/\d{14}/.test(location.href)) {
var fotoSyntax = Ten.querySelector('#breadcrumbs input');
if (!fotoSyntax || !fotoSyntax.value) return;
if (window.prompt('Sure?', fotoSyntax.value)) {
location.href = 'http://h.hatena.ne.jp/?_charset_=utf-8&body=' + fotoSyntax.value;
}
}
})();
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。