Skip to content

Instantly share code, notes, and snippets.

@ucnv
Created March 10, 2009 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucnv/76785 to your computer and use it in GitHub Desktop.
Save ucnv/76785 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Tokyo Kafun Twitter
// @namespace http://userscripts.org/users/40991
// @include http://twitter.com/home
// @include http://twitter.com/
// ==/UserScript==
var kafunUrl = 'http://pollen.tokyo-kafun.jp/kafun/index.php?action=KafunMapNew';
GM_xmlhttpRequest({ method:"GET", url: kafunUrl, onload: function(res) {
var match = /src="(Data\/bunpuzu\/\d+\/polmpp_\d+\.jpeg\?\d+)"/.exec(res.responseText);
if(match == null) return;
var $ = unsafeWindow.jQuery;
$('#primary_nav').before(
$(document.createElement('a'))
.attr('href', kafunUrl)
.append(
$(document.createElement('img'))
.css('width', '198px')
.attr('src', 'http://pollen.tokyo-kafun.jp/kafun/' + match[1])
)
);
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment