Permalink
Browse files

YouTubeからポストできるように(thanks utatane/torques)

  • Loading branch information...
to committed Aug 17, 2010
1 parent 4276085 commit 680fb21c540e43425ecbd76480540cb27443f000
Showing with 9 additions and 3 deletions.
  1. +9 −3 xpi/chrome/content/library/31_Tombloo.Service.extractors.js
@@ -1262,15 +1262,21 @@ Tombloo.Service.extractors = new Repository([
return ctx.host.match('youtube.com');
},
extract : function(ctx){
var author = $x('id("watch-channel-stats")/a');
var author_anchor = $x('id("watch-channel-stats")/a', ctx.document) || $x('id("watch-username")', ctx.document);
if (author_anchor) {
var author = author_anchor.textContent;
} else {
var banner = $x('id("watch-userbanner")/descendant::img');
var author = banner.title;
}
ctx.title = ctx.title.replace(/[\n\r\t]+/gm, ' ').trim();
return {
type : 'video',
item : ctx.title.extract(/ - (.*)/),
item : ctx.title.extract(/\s- (.*)/),
itemUrl : ctx.href,
author : author.textContent,
authorUrl : author.href,
authorUrl : author.href
};
},
},

0 comments on commit 680fb21

Please sign in to comment.