diff options
author | snaka | 2009-05-19 15:39:32 +0000 |
---|---|---|
committer | snaka | 2009-05-19 15:39:32 +0000 |
commit | 25844dd69b38358ed8591b6ee5e8c3dcacf071e9 (patch) | |
tree | 8a318ed4838db8414287ef9c0c5aeea1e699631a /pino.js | |
parent | bf398ff220d62d2c6cd46f558ec6f3fcf298e761 (diff) | |
download | vimperator-plugins-25844dd69b38358ed8591b6ee5e8c3dcacf071e9.tar.bz2 |
proxy経由だとピンの一覧取得APIへのアクセスが失敗する場合があったので修正。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@33416 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'pino.js')
-rw-r--r-- | pino.js | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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; } |