aboutsummaryrefslogtreecommitdiffstats
path: root/direct_bookmark.js
diff options
context:
space:
mode:
authorthinca2011-05-27 02:56:35 +0900
committerthinca2011-05-27 02:56:35 +0900
commitc3b557ff8750c8f482712b599ca15c9b678bf33e (patch)
tree4b931ca03c722676976d24b9464658adc6cabe6e /direct_bookmark.js
parent049fbb0ad20edb7e037c32374cecb5dfde66a504 (diff)
downloadvimperator-plugins-c3b557ff8750c8f482712b599ca15c9b678bf33e.tar.bz2
Supported tags for Google Bookmarks.
Diffstat (limited to 'direct_bookmark.js')
-rw-r--r--direct_bookmark.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/direct_bookmark.js b/direct_bookmark.js
index f58e027..37f80b6 100644
--- a/direct_bookmark.js
+++ b/direct_bookmark.js
@@ -28,6 +28,7 @@ for Migemo search: require XUL/Migemo Extension
'h': Hatena Bookmark
'd': del.icio.us
'l': livedoor clip
+ 'g': Google Bookmarks
'p': Places (Firefox bookmarks)
Usage: let g:direct_sbm_use_services_by_tag = "hdl"
||<
@@ -503,7 +504,23 @@ for Migemo search: require XUL/Migemo Extension
if(xhr.status != 200) throw "Google Bookmarks: failed";
});
},
- tags:function(user,password) [],
+ tags:function(user,password){
+ var returnValue = [];
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", "https://www.google.com/bookmarks", false, user, password);
+ xhr.send(null);
+
+ var html = parseHTML(xhr.responseText);
+ var tags = getElementsByXPath('//a[contains(@id,"lbl_m_")]/text()',html);
+
+ tags.forEach(function(tag){
+ var text = tag.textContent;
+ if(text.match(/\S/)) {
+ returnValue.push(text);
+ }
+ });
+ return returnValue;
+ },
},
'f': {
description:'foves',