Skip to content

Instantly share code, notes, and snippets.

@negipo
Created October 31, 2010 14:57
Show Gist options
  • Save negipo/21255070eb4d299ee287 to your computer and use it in GitHub Desktop.
Save negipo/21255070eb4d299ee287 to your computer and use it in GitHub Desktop.
Tombloo.Service.extractors.register({
name : 'ReBlog - Dashboard',
ICON : 'chrome://tombloo/skin/reblog.ico',
check : function(ctx){
return (/(tumblr-beta\.com|tumblr\.com)\//).test(ctx.href) && this.getLink(ctx);
},
extract : function(ctx){
// タイトルなどを取得するためextractByLinkを使う(reblogリンクを取得しextractByEndpointを使った方が速い)
return Tombloo.Service.extractors.ReBlog.extractByLink(ctx, this.getLink(ctx));
},
getLink : function(ctx){
var link = $x('./ancestor-or-self::li[starts-with(normalize-space(@class), "post")]//a[@title="固定リンク"]', ctx.target);
return link && link.href;
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment