This is the first theoretical exercise of two which I need to complete to finish the last exercises of the Generative Design book. Here is a brief description of the Generative Design book: ‘In principle, all data that can be seen in a browser can also be loaded with another program and used for other purposes. If an HTML text from a web page is not required, but the data is needed in a more structured way, it is more convenient to have this information available in XML format. Luckily, this is now often the case. RSS feeds, for example, are a special XML format, and many Internet pages provide programming interfaces (so-called APIs) with which information in XML format can be specifically queried. The Wikipedia API offers a comprehensive programming interface that allows the user to both query the Wikipedia database and edit articles.’ Until here the summary of the Generative Design book. Here is the original program.
Getting data from the Internet is not new to me. I first came into contact with the Internet in 1992. I was working at Océ Research & Development. But I will not go into that any further because it is not relevant for this exercise. I usually download a text.csv or text.tsv file to use the data in data visualizations. But downloading data through an API I’ve never done before. So that is new to me.
Back to the Generative Design program M_6_2_01.pde. This program is not working. If I run it I get a [Fatal Error]: 1: 1: Premature end of file in my console. But because I have studied the Wikipedia API I suspect that this error is caused because the start of the URL in the program begins with http://. And I think the right URL should be: https://. It needs the ‘s’. https is ‘Hyper Text Transfer Protocol’ with Secure Sockets Layer (SSL). This is another protocol primarily developed with secure, safe Internet transactions in mind. So when I correct that and let the program run then I get a neat list of 27 numbered links from Wikipedia Superegg page in my Processing console. So I think this problem is now solved. I also tried other pages by requesting Superegg replacing Superegg with Generative%20Design (The% 20 comes from percent-encoding a space). I have done the same with New%20York, Steve%20Jobs, Dada and Kurt%20Schwitters. And these URL’s all work fine. All links on those pages are neatly sorted in alphabetical order and displayed in my Processing console. I think that this exercise is over. Furthermore, there are no graphics or variations of the program involved.