Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

xml retrieval

$
0
0
Hello processOrs.

I'm new to processing but I already have figured out most of the basic concepts.

I'm currently trying to make an interface to visualize the data in that xml

My problem is that I can't even get the data 
I have tried with getXML - not working
  1. void setup() {
  2. XML xml = loadXML("http://www.teamliquid.net/video/streams/?xml=1&filter=live");
  3.  println(xml);    
  4. }

 java.io.IOException: Server returned HTTP response code: 406 for URL: http://www.teamliquid.net/video/streams/?xml=1&filter=live
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at java.net.URL.openStream(URL.java:1010)
at processing.core.PApplet.createInputRaw(PApplet.java:7001)
at processing.core.PApplet.createInput(PApplet.java:6969)
at processing.core.PApplet.createReader(PApplet.java:6763)
at processing.core.PApplet.loadXML(PApplet.java:6105)
at processing.core.PApplet.loadXML(PApplet.java:6095)
at HTTPClient.setup(HTTPClient.java:18)
at processing.core.PApplet.handleDraw(PApplet.java:2280)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2176)
at java.lang.Thread.run(Thread.java:662)
java.net.MalformedURLException
at java.net.URL.<init>(URL.java:601)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at processing.data.XML.<init>(XML.java:170)
at processing.core.PApplet.loadXML(PApplet.java:6105)
at processing.core.PApplet.loadXML(PApplet.java:6095)
at HTTPClient.setup(HTTPClient.java:18)
null
at processing.core.PApplet.handleDraw(PApplet.java:2280)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2176)
at java.lang.Thread.run(Thread.java:662)


I tried to use the example HTTPclient - not working
  1. import processing.net.*;

  2. Client c;
  3. String data;

  4. void setup() {
  5.   size(200, 200);
  6.   background(50);
  7.   fill(200);
  8.   c = new Client(this, "http://www.teamliquid.net/video/streams/?xml=1&filter=live", 80); // Connect to server on port 80
  9.   c.write("GET / HTTP/1.0\r\n"); // Use the HTTP "GET" command to ask for a Web page
  10.   c.write("\r\n");
  11. }

  12. void draw() {
  13.   if (c.available() > 0) { // If there's incoming data from the client...
  14.     data = c.readString(); // ...then grab it and print it
  15.     println(data);
  16.   }
  17. }
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at processing.net.Client.<init>(Unknown Source)
at HTTPClient.setup(HTTPClient.java:42)
at processing.core.PApplet.handleDraw(PApplet.java:2280)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2176)
at java.lang.Thread.run(Thread.java:662)
java.lang.NullPointerException
at processing.net.Client.write(Unknown Source)
at processing.net.Client.write(Unknown Source)
at HTTPClient.setup(HTTPClient.java:43)
at processing.core.PApplet.handleDraw(PApplet.java:2280)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2176)
at java.lang.Thread.run(Thread.java:662)
java.lang.NullPointerException
at processing.net.Client.write(Unknown Source)
at processing.net.Client.write(Unknown Source)
at HTTPClient.setup(HTTPClient.java:44)
at processing.core.PApplet.handleDraw(PApplet.java:2280)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
at processing.core.PApplet.run(PApplet.java:2176)
at java.lang.Thread.run(Thread.java:662)
I also tried to use saveStrings(); -  still not working.

Can someone help me with that please.

Thank you!

Viewing all articles
Browse latest Browse all 1768

Trending Articles