Skip to content

Instantly share code, notes, and snippets.

@dukex
Created May 11, 2012 21:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dukex/2662645 to your computer and use it in GitHub Desktop.
Save dukex/2662645 to your computer and use it in GitHub Desktop.
Reactive Scraper Example
<!-- http://reactivescraper.herokuapp.com/test.html -->
<html>
<head>
<title>Test</title>
</head>
<body>
<ul>
<li>
<span class="name"> Jonh </span>
<span class="votes"> 90 </span>
</li>
<li>
<span class="name"> Marie </span>
<span class="votes"> 3 </span>
</li>
<li>
<span class="name"> Paul </span>
<span class="votes"> 10 </span>
</li>
</ul>
</body>
</html>
$("li").each(function(){
document.save({
name: $(this).find(".name").text(),
votes: $(this).find(".votes").text()
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment