I would like to get free stock feeds from yahoo or google.
Java code.
anyone has an idea?
TY
Printable View
I would like to get free stock feeds from yahoo or google.
Java code.
anyone has an idea?
TY
If you can get an XML feed that should be pretty simple.
From there all you have to do is parse the XML String into a Document using DocumentBuilderFactory and then loop through the nodes.Code:public String getXMLString(String xmlFileURL) {
String output = " ";
InputStream in = null;
BufferedReader reader = null;
try {
in = new URL.openStream(xmlFileURL);
reader = new BufferedReader(new InputStreamReader(in));
String read;
while ((read = reader.readLine())!=null) {
output += read;
}
in.close();
reader.close();
} catch (MalformedURLException e) {
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
return output;
}
(See docs for: org.w3c.dom.Document, org.w3c.dom.Element, org.w3c.dom.Node, org.w3c.dom.NodeList)