# HG changeset patch # User Atul Varma # Date 1235854970 28800 # Node ID 4dd50afc32c85ce1d4df53159d1c7b89a88d5b7e # Parent 58d9c5ef124e685b02a9df3a17588ac10da0535c Successfully getting headlines and body of each article. diff -r 58d9c5ef124e -r 4dd50afc32c8 about-mozilla.js --- a/about-mozilla.js Sat Feb 28 12:24:58 2009 -0800 +++ b/about-mozilla.js Sat Feb 28 13:02:50 2009 -0800 @@ -1,5 +1,19 @@ +function onIssueLoaded() { + $("a[name]").each( + function(i) { + var headline = $(this).next().text(); + var body = $("
"); + for (var node = $(this).parent().next(); + node.length && !node.find("a[name]").length; + node = node.next(":not(.postmetadata)")) + body.append(node.clone()); + } + ); +} + $(window).ready( function() { - $(document.body).load("issue-2009-02-24.html .post", - null); + $(document.body).load("issue-2009-02-24.html .entry", + null, + onIssueLoaded); });