Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created December 23, 2011 13:44
Show Gist options
  • Save eagletmt/1514242 to your computer and use it in GitHub Desktop.
Save eagletmt/1514242 to your computer and use it in GitHub Desktop.
Tombloo extractor for Danbooru
(function() {
Tombloo.Service.extractors.register({
name : 'Photo - Danbooru',
ICON : 'http://danbooru.donmai.us/favicon.ico',
URL : 'http://danbooru.donmai.us/',
check : function(ctx) {
const DANBOORU_LIKE_SITES = [
'://danbooru.donmai.us/post/show/',
'://yande.re/post/show/',
'://konachan.com/post/show/',
];
return DANBOORU_LIKE_SITES.some(function(p) { return ctx.href.indexOf(p) != -1; });
},
extract : function(ctx) {
return {
type: 'photo',
item: ctx.title,
itemUrl: $x('id("highres")/@href'),
};
}
}, 'Photo', false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment