Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 6 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
97 xpi/chrome/content/library/20_model.js
@@ -781,39 +781,6 @@ models.register({
});
-models.register({
- name : 'Jaiku',
- ICON : 'http://jaiku.com/favicon.ico',
-
- URL : 'http://jaiku.com/',
-
- check : function(ps){
- return (/(regular|photo|quote|link|conversation|video)/).test(ps.type) && !ps.file;
- },
-
- getCurrentUser : function(){
- if(getCookieString('jaiku.com').match(/jaikuuser_.+?=(.+?);/))
- return RegExp.$1;
-
- throw new Error(getMessage('error.notLoggedin'));
- },
-
- post : function(ps){
- this.getCurrentUser();
-
- return request(Jaiku.URL).addCallback(function(res){
- var form = formContents(convertToHTMLDocument(res.responseText));
- return request(Jaiku.URL, {
- redirectionLimit : 0,
- sendContent : {
- _nonce : form._nonce,
- message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
- },
- });
- });
- },
-});
-
models.register(update({
name : 'Plurk',
ICON : 'http://www.plurk.com/static/favicon.png',
@@ -1100,7 +1067,7 @@ models.register({
saveQuicknote : 'save',
format : 'microclip',
- url : ps.itemUrl || 'no url',
+ url : ps.itemUrl,
title : ps.item || 'no title',
comment : ps.description,
body : getFlavor(ps.body, 'html'),
@@ -2443,68 +2410,6 @@ models.register({
});
models.register({
- name : '絶対復習',
- URL : 'http://www.takao7.net',
- ICON : 'chrome://tombloo/skin/item.ico',
-
- getAuthCookie : function(){
- return getCookieString('www.takao7.net', 'brushup_auth_token').split('=').pop();
- },
-
- check: function(ps) {
- return (/(regular|link|quote)/).test(ps.type) && !ps.file;
- },
-
- post: function(ps) {
- return this.add(ps.item, joinText([ps.itemUrl, ps.body, ps.description], '\n'), ps.tags);
- },
-
- add : function(title, description, tags){
- var self = this;
- return request(this.URL + '/brushup/reminders/new').addCallback(function(res){
- if(res.channel.URI.asciiSpec.match('login'))
- throw new Error(getMessage('error.notLoggedin'));
-
- var doc = convertToHTMLDocument(res.responseText);
- var form = formContents(doc);
-
- return request(self.URL + $x('id("new_reminder")/@action', doc), {
- redirectionLimit : 0,
- sendContent : update(form, {
- 'reminder[title]' : title,
- 'reminder[body]' : description,
- 'reminder[tag_list]' : joinText(tags, ' '),
- }),
- });
- });
- },
-});
-
-models.register({
- name: 'Femo',
- ICON: 'http://femo.jp/favicon.ico',
- POST_URL: 'http://femo.jp/create/post',
-
- check: function(ps) {
- return (/(regular|photo|quote|link|conversation|video)/).test(ps.type) && !ps.file;
- },
-
- post: function(ps) {
- return this.addMemo(ps);
- },
-
- addMemo : function(ps){
- return request(this.POST_URL, {
- sendContent: {
- title : ps.item,
- text : joinText([ps.itemUrl, ps.body, ps.description], '\n'),
- tagtext : joinText(ps.tags, ' '),
- },
- });
- },
-});
-
-models.register({
name : 'MediaMarker',
ICON : 'http://mediamarker.net/favicon.ico',
check : function(ps){
View
24 xpi/chrome/content/library/31_Tombloo.Service.extractors.js
@@ -608,7 +608,7 @@ Tombloo.Service.extractors = new Repository([
name : 'Photo - Flickr',
ICON : models.Flickr.ICON,
- RE : new RegExp('^http://(?:.+?.)?static.flickr.com/\\d+?/(\\d+?)_.*'),
+ RE : new RegExp('^http://(?:.+?.)?static.?flickr.com/\\d+?/(\\d+?)_.*'),
getImageId : function(ctx){
// 他サイトに貼られているFlickrにも対応する
if(/flickr\.com/.test(ctx.host)){
@@ -697,6 +697,7 @@ Tombloo.Service.extractors = new Repository([
{
name : 'Photo - Kiva',
+ retryLimit : 1,
check : function(ctx){
return (ctx.onImage && this.isOriginalUrl(ctx.target.src)) ||
(ctx.onLink && this.isOriginalUrl(ctx.link.href));
@@ -714,19 +715,17 @@ Tombloo.Service.extractors = new Repository([
return /^http:\/\/www\.kiva\.org\/img\//.test(url);
},
getFinalUrl : function(url, retryCount){
+ var self = this;
+
retryCount = retryCount || 0;
- var self = this;
- if(!this.isOriginalUrl(url))
+ // リダイレクト先が取得できるか、または、リダイレクトがないか?
+ // (S3のアドレスに変わらるものが少なくなった)
+ if(!this.isOriginalUrl(url) || retryCount >= this.retryLimit)
return succeed(url);
- if(retryCount > 5)
- throw 'Kiva: retry over.';
-
return getFinalUrl(url).addBoth(function(url){
- return (retryCount? wait(3) : succeed()).addCallback(function(){
- return self.getFinalUrl(url, ++retryCount);
- });
+ return wait(3).addCallback(bind('getFinalUrl', self, url, ++retryCount));
});
},
},
@@ -1340,10 +1339,13 @@ Tombloo.Service.extractors = new Repository([
itemUrl : ctx.href,
}
- var elmAuthor = $x('id("watch-username")');
+ var elmAuthor =
+ $x('id("watch-channel-stats")/a') ||
+ $x('id("watch-username")') ||
+ $x('id("watch-uploader-info")/descendant::a[contains(concat(" ", normalize-space(@rel), " "), " author ")]');
if(elmAuthor){
ps.authorUrl = elmAuthor.href;
- ps.author = elmAuthor.textContent;
+ ps.author = elmAuthor.textContent.trim();
}
return ps;
View
6 xpi/components/tombloo.js
@@ -267,11 +267,13 @@ Module = {
});
}
- // Scriptishサンドボックスの拡張
- if(env.getExtensionDir('scriptish@erikvold.com')){
+ try{
+ // Scriptishサンドボックスの拡張
var scope = {};
Components.utils.import('resource://scriptish/api.js', scope);
scope.GM_API.prototype.GM_Tombloo = GM_Tombloo;
+ }catch(e){
+ // インストールされていない場合や無効になっている場合にエラーになる
}
env.signal(env, 'environment-load');

No commit comments for this range

Something went wrong with that request. Please try again.