Created
October 20, 2012 20:35
-
-
Save aaronjorbin/3924712 to your computer and use it in GitHub Desktop.
Get a list of all twitter handles at WordCamp Philly 2012
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get Twitter accounts on the WC Philly 2012 site | |
var page = require('webpage').create(), | |
system = require('system'); | |
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
// Open the page, onPageLoad, do... | |
page.open(encodeURI("http://2012.philly.wordcamp.org/about/attendees/" ), function (status) { | |
// Check for page load success | |
if (status !== "success") { | |
console.log("Unable to access network"); | |
} else { | |
// Execute some DOM inspection within the page context | |
page.evaluate(function() { | |
var list = document.querySelectorAll('a.tix-attendee-twitter'); | |
for (var i = 0; i < list.length; ++i) { | |
console.log( list[i].innerText ); | |
} | |
}); | |
} | |
phantom.exit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment