Hi, I'm trying to get info from wikipedia using the wikimedia API but I dont know how to identify my client when using the network library included in processing. Seems like wikimedia API dont like the default "User-Agent" id. Anybody knows about this?
this is the code so far (and thank you for reading):
- import processing.net.*;
- Client c;
- void setup() {
- c = new Client(this, "wikipedia.org", 80);
- c.write("GET http://en.wikipedia.org/w/api.php?action=parse&page=google&prop=text&format=json&callback=?\n"); // some url found on the internet, just for trying
- }
- void draw() {
- if (c.available() > 0) {
- String data = c.readString();
- println(data);
- }
- }
1