Skip to content

Instantly share code, notes, and snippets.

@june29
Created November 22, 2012 01:48
Show Gist options
  • Save june29/4128978 to your computer and use it in GitHub Desktop.
Save june29/4128978 to your computer and use it in GitHub Desktop.
$(".comments-entry").each(function() {
var comment = $(this);
var icon_url = comment.find(".icon").attr("src");
var user_name = comment.find("dl dt strong a").text();
var entry_title = comment.find("dl dd a").text();
var entry_url = comment.find("dl dd a").attr("href");
var result = '{';
result += '\n title: "' + entry_title + '"';
result += '\n url: "' + entry_url + '"';
result += '\n author: {';
result += '\n name: "' + user_name + '"';
result += '\n icon: "' + icon_url + '"';
result += '\n }';
result += "\n}"
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment