diff options
author | janus_wel | 2010-10-31 00:51:21 +0900 |
---|---|---|
committer | janus_wel | 2010-10-31 00:51:21 +0900 |
commit | 3449232015d4324a3ce0c3e5b390e4676461a571 (patch) | |
tree | 5a3543c0feaa22fe34c349ed01143a9a616a7652 /direct_bookmark.js | |
parent | 60ca884b6f39d12042955a7100abddfe17e6837b (diff) | |
download | vimperator-plugins-3449232015d4324a3ce0c3e5b390e4676461a571.tar.bz2 |
Provide first aid for closing pathtraq API
uses "link" element that has rel="canonical" attr
instead of pathtraq URL canonicalization API
Signed-off-by: janus_wel <janus.wel.3@gmail.com>
Diffstat (limited to 'direct_bookmark.js')
-rw-r--r-- | direct_bookmark.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/direct_bookmark.js b/direct_bookmark.js index 05e955a..df4f1ab 100644 --- a/direct_bookmark.js +++ b/direct_bookmark.js @@ -297,14 +297,8 @@ for Migemo search: require XUL/Migemo Extension //
function getNormalizedPermalink(url){
- var xhr = new XMLHttpRequest();
- xhr.open("GET","http://api.pathtraq.com/normalize_url?url=" + url,false);
- xhr.send(null);
- if(xhr.status != 200){
- liberator.echoerr("Pathtraq: FAILED to normalize URL!!");
- return undefined;
- }
- return xhr.responseText;
+ var canonical = plugins.libly.$U.getFirstNodeFromXPath('//link[@rel="canonical"]').href;
+ return canonical ? canonical : url;
}
function getUserAccount(form,post,arg){
|