You want to get the price of the latest trade, or the most recent best bid and best ask?
If the former, check out this script written in Python that uses the HTTP Rest API and a sqlite database (you could replace that of course). Also note the 10 second delay that is built in between requests.
http://cahier2.ww7.be/bitcoinmirror/phantomcircuit/mtgox.pyIt should give you an idea on how to implement this (if you want the most recent best bid ans ask you could change some things like the url to be called and the handling of the json).
You could start this script of with a cronjob, and to be sure it keeps running do a restart hourly through a cronjob.
Does this help you?