Skip to content
This repository
  • 8 commits
  • 6 files changed
  • 0 comments
  • 1 contributor
BIN  tombloo.xpi
Binary file not shown
26 update.rdf
@@ -2,21 +2,21 @@
2 2 <RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
3 3 xmlns:NC="http://home.netscape.com/NC-rdf#"
4 4 xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5   - <RDF:Description RDF:about="rdf:#$mzDI."
6   - em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
7   - em:minVersion="3.5"
8   - em:maxVersion="100.0.*"
9   - em:updateLink="http://github.com/to/tombloo/raw/release/tombloo.xpi"
10   - em:updateHash="sha512:a76ce220da3b3e07008789f7ddd9adf05a171cb6079961c4e17b72734d931f18b85e2d8e701225678114e32f1b4f5da1203993de98cc39f8884ea02268b73463" />
11   - <RDF:Seq RDF:about="rdf:#$izDI.">
12   - <RDF:li RDF:resource="rdf:#$jzDI."/>
  5 + <RDF:Seq RDF:about="rdf:#$9Evte2">
  6 + <RDF:li RDF:resource="rdf:#$aEvte2"/>
13 7 </RDF:Seq>
14 8 <RDF:Description RDF:about="urn:mozilla:extension:tombloo@brasil.to"
15   - em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAFljYkFP6r5OXeVIrIXyEc0i9vW1O+h1UAkhbgzyP2xh8pD3smFDWQIgAkuzl716kCSzVNIG+Qctc8BE5MSUFt6bzoaaMzjKp8AvoRDEQIWbe7dxyFPXM5/3l3Skep+OTyqwrjHOMXB+rYYPab+aS8MN3TiEmCwYvGMgO6LKEwlO">
16   - <em:updates RDF:resource="rdf:#$izDI."/>
  9 + em:signature="MIGTMA0GCSqGSIb3DQEBDQUAA4GBAHJAgEFW+pUTDVGGZAmnaOKPclAQnGHGPrKFeWkdLqyRcqFdCfP4Ae7NGMwY2c25tRCsW6FZO3H+tUnEPbW+RTxbY1T/+j+sLI85vezLZDLoZpZ8Q84dUIPAiqogLkgrGUJvfn6KAHhR9Y1AA28JqJSCs9Q7WYJbI+2atEHlM7bK">
  10 + <em:updates RDF:resource="rdf:#$9Evte2"/>
17 11 </RDF:Description>
18   - <RDF:Description RDF:about="rdf:#$jzDI."
19   - em:version="0.4.27">
20   - <em:targetApplication RDF:resource="rdf:#$mzDI."/>
  12 + <RDF:Description RDF:about="rdf:#$aEvte2"
  13 + em:version="0.4.28">
  14 + <em:targetApplication RDF:resource="rdf:#$dEvte2"/>
21 15 </RDF:Description>
  16 + <RDF:Description RDF:about="rdf:#$dEvte2"
  17 + em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
  18 + em:minVersion="3.5"
  19 + em:maxVersion="100.0.*"
  20 + em:updateLink="http://github.com/to/tombloo/raw/release/tombloo.xpi"
  21 + em:updateHash="sha512:a1743eef049696074dd1984f488c11c28b0c8414c3733cd27d93750c72fc098f0a61ed814114888cb3eab5f50a3b30b9d1c8939d2bf7865ae87285b343cdd816" />
22 22 </RDF:RDF>
111 xpi/chrome/content/library/20_model.js
@@ -781,39 +781,6 @@ models.register({
781 781 });
782 782
783 783
784   -models.register({
785   - name : 'Jaiku',
786   - ICON : 'http://jaiku.com/favicon.ico',
787   -
788   - URL : 'http://jaiku.com/',
789   -
790   - check : function(ps){
791   - return (/(regular|photo|quote|link|conversation|video)/).test(ps.type) && !ps.file;
792   - },
793   -
794   - getCurrentUser : function(){
795   - if(getCookieString('jaiku.com').match(/jaikuuser_.+?=(.+?);/))
796   - return RegExp.$1;
797   -
798   - throw new Error(getMessage('error.notLoggedin'));
799   - },
800   -
801   - post : function(ps){
802   - this.getCurrentUser();
803   -
804   - return request(Jaiku.URL).addCallback(function(res){
805   - var form = formContents(convertToHTMLDocument(res.responseText));
806   - return request(Jaiku.URL, {
807   - redirectionLimit : 0,
808   - sendContent : {
809   - _nonce : form._nonce,
810   - message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
811   - },
812   - });
813   - });
814   - },
815   -});
816   -
817 784 models.register(update({
818 785 name : 'Plurk',
819 786 ICON : 'http://www.plurk.com/static/favicon.png',
@@ -1100,7 +1067,7 @@ models.register({
1100 1067 saveQuicknote : 'save',
1101 1068 format : 'microclip',
1102 1069
1103   - url : ps.itemUrl || 'no url',
  1070 + url : ps.itemUrl,
1104 1071 title : ps.item || 'no title',
1105 1072 comment : ps.description,
1106 1073 body : getFlavor(ps.body, 'html'),
@@ -1274,8 +1241,15 @@ models.register(update({}, AbstractSessionService, {
1274 1241 })
1275 1242 }).addCallback(function(res){
1276 1243 var doc = convertToHTMLDocument(res.responseText);
  1244 + var form = {};
  1245 + items(formContents(doc.documentElement)).forEach(function([key, value]){
  1246 + form[key.replace(/[A-Z]/g, function(c){
  1247 + return '_' + c.toLowerCase()
  1248 + })] = value;
  1249 + });
  1250 +
1277 1251 return request('http://www.delicious.com/save', {
1278   - sendContent : update(formContents(doc), {
  1252 + sendContent : update(form, {
1279 1253 title : ps.item,
1280 1254 url : ps.itemUrl,
1281 1255 note : joinText([ps.body, ps.description], ' ', true),
@@ -1283,6 +1257,11 @@ models.register(update({}, AbstractSessionService, {
1283 1257 private : ps.private,
1284 1258 }),
1285 1259 });
  1260 + }).addCallback(function(res){
  1261 + res = JSON.parse(res.responseText);
  1262 +
  1263 + if(res.error)
  1264 + throw new Error(res.error_msg);
1286 1265 });
1287 1266 },
1288 1267
@@ -2443,68 +2422,6 @@ models.register({
2443 2422 });
2444 2423
2445 2424 models.register({
2446   - name : '絶対復習',
2447   - URL : 'http://www.takao7.net',
2448   - ICON : 'chrome://tombloo/skin/item.ico',
2449   -
2450   - getAuthCookie : function(){
2451   - return getCookieString('www.takao7.net', 'brushup_auth_token').split('=').pop();
2452   - },
2453   -
2454   - check: function(ps) {
2455   - return (/(regular|link|quote)/).test(ps.type) && !ps.file;
2456   - },
2457   -
2458   - post: function(ps) {
2459   - return this.add(ps.item, joinText([ps.itemUrl, ps.body, ps.description], '\n'), ps.tags);
2460   - },
2461   -
2462   - add : function(title, description, tags){
2463   - var self = this;
2464   - return request(this.URL + '/brushup/reminders/new').addCallback(function(res){
2465   - if(res.channel.URI.asciiSpec.match('login'))
2466   - throw new Error(getMessage('error.notLoggedin'));
2467   -
2468   - var doc = convertToHTMLDocument(res.responseText);
2469   - var form = formContents(doc);
2470   -
2471   - return request(self.URL + $x('id("new_reminder")/@action', doc), {
2472   - redirectionLimit : 0,
2473   - sendContent : update(form, {
2474   - 'reminder[title]' : title,
2475   - 'reminder[body]' : description,
2476   - 'reminder[tag_list]' : joinText(tags, ' '),
2477   - }),
2478   - });
2479   - });
2480   - },
2481   -});
2482   -
2483   -models.register({
2484   - name: 'Femo',
2485   - ICON: 'http://femo.jp/favicon.ico',
2486   - POST_URL: 'http://femo.jp/create/post',
2487   -
2488   - check: function(ps) {
2489   - return (/(regular|photo|quote|link|conversation|video)/).test(ps.type) && !ps.file;
2490   - },
2491   -
2492   - post: function(ps) {
2493   - return this.addMemo(ps);
2494   - },
2495   -
2496   - addMemo : function(ps){
2497   - return request(this.POST_URL, {
2498   - sendContent: {
2499   - title : ps.item,
2500   - text : joinText([ps.itemUrl, ps.body, ps.description], '\n'),
2501   - tagtext : joinText(ps.tags, ' '),
2502   - },
2503   - });
2504   - },
2505   -});
2506   -
2507   -models.register({
2508 2425 name : 'MediaMarker',
2509 2426 ICON : 'http://mediamarker.net/favicon.ico',
2510 2427 check : function(ps){
24 xpi/chrome/content/library/31_Tombloo.Service.extractors.js
@@ -608,7 +608,7 @@ Tombloo.Service.extractors = new Repository([
608 608 name : 'Photo - Flickr',
609 609 ICON : models.Flickr.ICON,
610 610
611   - RE : new RegExp('^http://(?:.+?.)?static.flickr.com/\\d+?/(\\d+?)_.*'),
  611 + RE : new RegExp('^http://(?:.+?.)?static.?flickr.com/\\d+?/(\\d+?)_.*'),
612 612 getImageId : function(ctx){
613 613 // 他サイトに貼られているFlickrにも対応する
614 614 if(/flickr\.com/.test(ctx.host)){
@@ -697,6 +697,7 @@ Tombloo.Service.extractors = new Repository([
697 697
698 698 {
699 699 name : 'Photo - Kiva',
  700 + retryLimit : 1,
700 701 check : function(ctx){
701 702 return (ctx.onImage && this.isOriginalUrl(ctx.target.src)) ||
702 703 (ctx.onLink && this.isOriginalUrl(ctx.link.href));
@@ -714,19 +715,17 @@ Tombloo.Service.extractors = new Repository([
714 715 return /^http:\/\/www\.kiva\.org\/img\//.test(url);
715 716 },
716 717 getFinalUrl : function(url, retryCount){
  718 + var self = this;
  719 +
717 720 retryCount = retryCount || 0;
718 721
719   - var self = this;
720   - if(!this.isOriginalUrl(url))
  722 + // リダイレクト先が取得できるか、または、リダイレクトがないか?
  723 + // (S3のアドレスに変わらるものが少なくなった)
  724 + if(!this.isOriginalUrl(url) || retryCount >= this.retryLimit)
721 725 return succeed(url);
722 726
723   - if(retryCount > 5)
724   - throw 'Kiva: retry over.';
725   -
726 727 return getFinalUrl(url).addBoth(function(url){
727   - return (retryCount? wait(3) : succeed()).addCallback(function(){
728   - return self.getFinalUrl(url, ++retryCount);
729   - });
  728 + return wait(3).addCallback(bind('getFinalUrl', self, url, ++retryCount));
730 729 });
731 730 },
732 731 },
@@ -1340,10 +1339,13 @@ Tombloo.Service.extractors = new Repository([
1340 1339 itemUrl : ctx.href,
1341 1340 }
1342 1341
1343   - var elmAuthor = $x('id("watch-username")');
  1342 + var elmAuthor =
  1343 + $x('id("watch-channel-stats")/a') ||
  1344 + $x('id("watch-username")') ||
  1345 + $x('id("watch-uploader-info")/descendant::a[contains(concat(" ", normalize-space(@rel), " "), " author ")]');
1344 1346 if(elmAuthor){
1345 1347 ps.authorUrl = elmAuthor.href;
1346   - ps.author = elmAuthor.textContent;
  1348 + ps.author = elmAuthor.textContent.trim();
1347 1349 }
1348 1350
1349 1351 return ps;
6 xpi/components/tombloo.js
@@ -267,11 +267,13 @@ Module = {
267 267 });
268 268 }
269 269
270   - // Scriptishサンドボックスの拡張
271   - if(env.getExtensionDir('scriptish@erikvold.com')){
  270 + try{
  271 + // Scriptishサンドボックスの拡張
272 272 var scope = {};
273 273 Components.utils.import('resource://scriptish/api.js', scope);
274 274 scope.GM_API.prototype.GM_Tombloo = GM_Tombloo;
  275 + }catch(e){
  276 + // インストールされていない場合や無効になっている場合にエラーになる
275 277 }
276 278
277 279 env.signal(env, 'environment-load');
2  xpi/install.rdf
@@ -6,7 +6,7 @@
6 6 <em:id>tombloo@brasil.to</em:id>
7 7 <em:type>2</em:type>
8 8 <em:name>Tombloo</em:name>
9   - <em:version>0.4.27</em:version>
  9 + <em:version>0.4.28</em:version>
10 10 <em:creator>to</em:creator>
11 11 <em:description></em:description>
12 12 <em:unpack>true</em:unpack>

No commit comments for this range

Something went wrong with that request. Please try again.