Created
July 11, 2012 19:46
-
-
Save crazy4groovy/3092794 to your computer and use it in GitHub Desktop.
Sites listed on Ebates.com
This file contains hidden or 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
| /* | |
| see: http://crazy4groovy.blogspot.ca/2011/03/yql-for-ebates-stores.html | |
| INTENDED FOR DEMO PURPOSES ONLY | |
| */ | |
| String endpoint = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.ebates.com%2Fstores%2Fall%2Findex.htm%22%20and%20xpath%3D%22%2F%2Fhtml%2Fbody%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fform%2Ftable%2Ftr%5B%40class%3D'store'%5D%2Ftd%5B%40class%3D'storeName'%5D%2Fstrong%2Fa%22" | |
| //println 'getting data...' | |
| def xml = endpoint.toURL().text | |
| //println 'got!\n' | |
| //println xml.size() | |
| List names = new XmlSlurper().parseText(xml).results.a.collect{it.@href.text() - '/stores/' - '.htm'} | |
| println "['" + names.sort().join("','") + "']" | |
| //return names.size() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment