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()
Tuesday, March 29, 2011
YQL for eBates Stores
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment