Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

As the title says, I am a recent graduate with a mathematics degree, looking to develop software as a career. The job hunting has not resulted in a job yet but over the past couple of months I have picked up quite a bit of Ruby/Rails and Objective-C, as well as learning git and deployed a simple web-app to Heroku.

I want to continue to build my resume and feel making a simple app and contributing to open source projects would look really good. Which leads me to my idea:

My girlfriend is a botanist with the California Native Plant Society, and they just put together this really cool rare plant database. So I'd like make a simple iPhone app which would allow the user to query that database. Eventually it would be neat to do other stuff, but just getting a prototype together that would allow lookup via scientific names of different plant species is my first goal.

I'm looking for any advice or resources as I'm not even sure what to google. I'm not sure if my app is physically filling in the text fields or if there is some other way to query an Internet database which I am unfamiliar.

CNPS is a pretty great not-for-profit and it would be neat to give back to them in some way. I plan to host this on github as well if anyone else is interested. Thanks

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I checked out the rare plant database that you were talking about and it doesn't seem like they provide an official API for you to use. However, all is not lost. If you know how HTTP requests work, you can create your own API that talks to the website.

When you enter a String of text in that textbox and hit send to submit a query. It is actually an "HTTP Post Request" that is sent to their web server. Their web server will send you back the list of plants for your query (it will also send you some image files, js files and CSS files for your browser to render it, but you can ignore those).

Of course, all this is happening under the hood, so you probably don't see it. What I did is I used a Firefox addon like "Live HTTP Headers", to view the messages that are being sent. Here is what I found:

GET /result.html?fulldata=swertia
GET /screen.css
GET /print.css
GET /org.cnps.Result/org.cnps.Result.nocache.js
GET /cnps-gwt.css
GET /__utm.gif?utmwv=5.1.2&utms=5&utmn=1059458291&utmhn=www.rareplants.cnps.org&utmcs=UTF-8&utmsr=1920x1080&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r85&utmdt=CNPS%20Inventory%20Results&utmhid=1684704704&utmr=0&utmp=%2Fresult.html%3Ffulldata%3Dswertia&utmac=UA-6730603-1&utmcc=__utma%3D174726397.718735014.1312838981.1312838981.1312838981.1%3B%2B__utmz%3D174726397.1312838981.1.1.utmcsr%3Dprogrammers.stackexchange.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2Fquestions%2F99496%2Frecent-graduate-with-an-idea-but-i-need-some-starting-out-advice%3B&utmu=qB~
GET /org.cnps.Result/D57E5252D4FED33E23687A9CD59DD3E7.cache.html
POST /data/inv 5|0|8|http://www.rareplants.cnps.org/org.cnps.Result/|E90C92B10BB688CC232EBF994E761ECD|org.cnps.client.InvDataService|readResults|java.util.HashMap/962170901|java.lang.String/2004016611|fulldata|swertia|1|2|3|4|1|5|5|1|6|7|6|8|

The very last line is the POST message. That's what I send to the web server. It contains my query for the plant I'm looking for (in my example "swertia").

The very top line results in me getting an html page called "result.html?fulldata=swertia". My guess is that your plants list is embedded somewhere in that html. (Strictly, just a guess because I haven't spent much time looking into it)

But yeah, so if you wanted something to Google, I'll start out with finding out how you can make HTTP Post requests from the iPhone SDK. Then you can worry about how to receive, extract and display the content after it gets back to your phone.

HTH. Let us know when your project is up on Github. I'll be interested in checking it out. Good luck!

share|improve this answer
1  
Hey thanks for setting me on a path with some new reading material. –  DubsGordon Aug 8 '11 at 22:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.