Skip to content

Commit

Permalink
YouTubeからポストできるように(thanks utatane/torques)
Browse files Browse the repository at this point in the history
  • Loading branch information
to committed Aug 17, 2010
1 parent 4276085 commit 680fb21
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions xpi/chrome/content/library/31_Tombloo.Service.extractors.js
Expand Up @@ -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
};
},
},
Expand Down

0 comments on commit 680fb21

Please sign in to comment.