0

YQL and Java

I would like to run YQL statements in my java program. Is that possible? Can you share an example?

Thanks

by
2 Replies
  • something like this could work:

    String requestQuery = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20location%3D90210&format=xml"
    HttpClient client = new HttpClient();
    GetMethod method = new GetMethod(requestQuery);
    // call method.getResultAsStream and store in an InputStream
    // use inputStream result and save in a Document
    // parse that via Xpath?
    0
  • Mozilla released a JavaScript engine for Java called Rhino. Just look up the ScriptEngineManager class of Java SE at http://goo.gl/AoqKV and the ScriptEngine class at http://goo.gl/W79Mc. Or just lookup http://goo.gl/ExT3P.
    0

Recent Posts

in YQL