Skip to content

Instantly share code, notes, and snippets.

@jacobandresen
Created April 19, 2015 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobandresen/214f1efcb14ac889caf0 to your computer and use it in GitHub Desktop.
Save jacobandresen/214f1efcb14ac889caf0 to your computer and use it in GitHub Desktop.
meetup extract (jsdom)
var jsdom = require("jsdom");
jsdom.env({
url: "http://www.meetup.com/Elasticsearch-Copenhagen-Meetup/events/221911024/",
scripts: ["http://code.jquery.com/jquery.js"],
done: function (errors, window) {
var $ = window.$;
var title = $('title').text();
var startDate = $($('time[itemprop=startDate]')[0]).attr('datetime');
var site = $($('#event-where')[0]).data('name');
var address = $($('#event-where')[0]).data('address');
console.log("title:", title, "startDate:", startDate, "site:", site, "address:", address);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment