From 25844dd69b38358ed8591b6ee5e8c3dcacf071e9 Mon Sep 17 00:00:00 2001 From: snaka Date: Tue, 19 May 2009 15:39:32 +0000 Subject: proxy経由だとピンの一覧取得APIへのアクセスが失敗する場合があったので修正。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@33416 d0d07461-0603-4401-acd4-de1884942a52 --- pino.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'pino.js') diff --git a/pino.js b/pino.js index f4e1966..0dbf3ec 100644 --- a/pino.js +++ b/pino.js @@ -158,7 +158,7 @@ liberator.plugins.pino.api = (function() { count: true, completer: function(context) { var pins = new Pins(); - context.title = ["title", "url"]; + context.title = ["url", "title"]; context.completions = [ [i.link, i.title] for each (i in pins.items()) ]; @@ -234,7 +234,10 @@ liberator.plugins.pino.api = (function() { var request = new libly.Request( baseURL() + "/api/pin/all", null, - { asynchronous: false } + { + asynchronous: false, + postBody: toQuery({ApiKey: this.apiKey}) + } ); request.addEventListener("onSuccess", function(data) { @@ -255,12 +258,13 @@ liberator.plugins.pino.api = (function() { var libly = plugins.libly; function getLDRApiKey() { - var uri = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService) - .newURI(baseURL(), null, null); + var ioService = Cc["@mozilla.org/network/io-service;1"] + .getService(Ci.nsIIOService); + var uri = ioService.newURI(baseURL(), null, null); + var channel = ioService.newChannelFromURI(uri); var cookie = Cc["@mozilla.org/cookieService;1"] .getService(Ci.nsICookieService) - .getCookieString(uri, null); + .getCookieString(uri, channel); var apiKey = cookie.match(/reader_sid=([^;]+)/); return apiKey ? apiKey[1]: null; } -- cgit v1.2.3