Monday, February 23, 2009

URL Interactions

Today's task was to create a program where I could test connecting to and interacting with a website. The site I am using is called Morphbank, which is a searchable database containing images of organisms for use by scientists.  

To get myself up to speed about Java and interacting with the internet, I read the networking chapter of "Core Java 2, Volume 2" Using their examples, I was able to create a program to connect with the Morphbank website and read in the HTML of the webpage I wanted. Next, since I'll actually want to input search data, I read through the HTML to find the necessary parameters and wrote a test function to post search data into the online form and return the result page. I filtered through the result HTML to find the lines containing image references and printed those to the screen. The next step will be harvesting those images and including them within the PhyloWidget program. I'll have to learn a little more before I understand exactly how to do that, but coming from absolutely no web-interaction experience and very little knowledge of HTML, I'm pretty proud of what I got done today. 

In other news, I'm in the middle of trying to figure out how to download the latest PhyloWidget code using a SVN client, but so far it hasn't worked. Even when it does, the code is read-only in that format, which won't be so useful to me since I'm hoping to modify it. I need to figure out the best way to update my code and then go ahead and do that. 

In general, I'm glad to say that I'm pretty well on target for next week's Alpha Review. I've made the decision to build on the existing PhyloWidget code in Java using the Processing UI libraries. I've made a sizable dent in understanding how all the code fits together and where I will be interacting with it most, like where to interrupt to cause label name changes, for example. I've refreshed my memory about Java enough to start writing successful programs, and I've learned how to use Eclipse. I've got some details to work out about my ultimate design goals and algorithms before submitting the revised design document, but I think I'm reasonably well on my way to figuring those things out, too.

No comments: