Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
del.icio.us IncSearch user-extension.js. Added private/public bookmark information to tags for del.icio.us IncSearch.
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
You can’t perform that action at this time.