// Delicious feeds URL // From http://www.delicious.com/help/feeds // "Bookmarks for a specific user" http://feeds.delicious.com/v2/json/(username) + '?callback=?' // Store bookmark's notes and tags invisibly with list element .data('extended', this.n) .data('tags', this.t) // Fix display glitch when copying element in drop event: .css({top: '0px', left: '0px'}) // Packaged data for POST var postData = { url: $bookmark.find('a').attr('href'), description: $bookmark.find('a').html(), extended: $bookmark.data('extended'), tags: $bookmark.data('tags').join(' ') + ' ' + newTrailName + ' ' + 'step:' + delicious.stepNum, method: 'posts/add', username: delicious.username, password: delicious.password }; // $.post callback function(rsp){ var rsp = eval( '(' + rsp + ')'); // The double parentheses are crucial. Omitting them will cause a parse error. if (rsp.result_code === "access denied") { alert('The provided Delicious username and password are incorrect.'); } else if (rsp.result_code === "something went wrong") { alert('There was an unspecified error communicating with Delicious.'); } else if (rsp.result_code === "done") { // Bookmark was saved properly $('#new-trail li:first').remove(); // Remove the line for the bookmark we just saved if ($('#new-trail li').length > 0) { // Save the next bookmark in the trail in 1000ms (1 second) // We have to wait this period of time to comply with the // terms of the Delicious API. If we don't we may have access denied. setTimeout(saveTrail, 1000); } else { // We're done saving the trail delicious.password = null; alert ("Your trail has been saved!"); } } }