Created
December 29, 2011 02:23
-
-
Save koyudoon/1531263 to your computer and use it in GitHub Desktop.
Patch for Taberareloo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Patch for Taberareloo | |
// Taberareloo (https://chrome.google.com/webstore/detail/ldcnohnnlpgglecmkldelbmiokgmikno) | |
// lib/models.js | |
// Models: GoogleBookmarks | |
// getUserTags() | |
getUserTags : function() { | |
return request('https://www.google.com/bookmarks/mark', { | |
queryString : { | |
op : 'add' | |
} | |
}).addCallback(function(res){ | |
var doc = createHTML(res.responseText); | |
var labels = doc.querySelectorAll( | |
'a[href^="/bookmarks/lookup?q=label:"]:not([href^="/bookmarks/lookup?q=label:%5Enone"])'); | |
var data = []; | |
var i = labels.length; | |
while(i--){ | |
data.push({ | |
'name': labels[i].firstChild.textContent.slice(0, -1), | |
'frequency': labels[i].firstElementChild.textContent.slice(1, -1) | |
}); | |
} | |
return data; | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ちょこっと高速化(たぶん)