From 3449232015d4324a3ce0c3e5b390e4676461a571 Mon Sep 17 00:00:00 2001 From: janus_wel Date: Sun, 31 Oct 2010 00:51:21 +0900 Subject: 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 --- direct_bookmark.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'direct_bookmark.js') 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){ -- cgit v1.2.3