Last active
December 15, 2015 04:58
-
-
Save onozaty/5205117 to your computer and use it in GitHub Desktop.
del.icio.us IncSearch user-extension.js.
Added private/public bookmark information to tags for del.icio.us IncSearch.
This file contains 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
DeliciousParser.parse = function(xml) { | |
var posts = xml.getElementsByTagName('post'); | |
var list = []; | |
for (var i = 0, len = posts.length; i < len; i++) { | |
var bookmark = {}; | |
var post = posts[i]; | |
bookmark.id = i; | |
bookmark.url = post.getAttribute('href'); | |
bookmark.title = post.getAttribute('description'); | |
bookmark.info = post.getAttribute('extended') || ''; | |
var isPrivate = (post.getAttribute('private') == 'yes'); | |
var tagString = isPrivate ? 'private' : 'public'; | |
var bookmarkTags = post.getAttribute('tag'); | |
if (bookmarkTags != '') { | |
tagString += ' ' + bookmarkTags; | |
} | |
bookmark.tags = '[' + tagString.replace(/ /g, '] [') + ']'; | |
bookmark.time = post.getAttribute('time'); | |
list.push(bookmark); | |
} | |
return list; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment