cURL Journal Using cURL to make the world go around at danallen.com
October 25, 2009 By Dan Allen
Fake IT People, you can tell by their spiffiness. Even though they are fake, the large white board and
relaxed atmosphere are crucial to the best IT work.
Thanks to cURL, the Earth is turning again. I am grateful and relieved.
Fix webcams that run with the spinning Earth at danallen.com DONE
Replace live image link from danallen.com with cron job that saves updated pic once per 15 minutes. DONE
Save those 15-minute pics for a year
Use pics from file instead of Swiss Observatory, to achieve spin independence
Be happy for being a step closer to fulfilling a dream
October 2009
The basic idea is to use cURL to read a webpage at the Swiss Earth Observatory, looking for the address of the earth image (sample), saving that address to a php variable that can then be used to display the latest live image on my website.
To see what CURL is going to do, surf over to the Swiss Earth Observatory. When you get there, right click in the white area of the page, and select VIEW SOURCE. This will display the web page code sent to your browser. The browser translates this code on your computer into the web page you see. The picture of Earth at that page has an address that always changes. To see what it is now, scan down the screen displayed by view source until you find
Once you've compiled PHP with cURL support (comes with Linux hosting from Godaddy), you can begin using the cURL functions.
The basic idea behind the cURL functions is that you initialize a cURL session using the curl_init(), then you can set all your options for the transfer via the curl_setopt(), then you can execute the session with the curl_exec() and then you finish off your session using the curl_close(). Here is an example that uses the cURL functions to fetch the example.com homepage into a file:
New Host Next Steps Rather than relying on email for a task list that is changing all the time, I am keeping the next steps and status on this page. By Dan Allen
Slow Is Fast Plugging Into Bedrock Even though immediate objectives are in sight, still necessary to delay speed for infrastructure development. In this case, infrastructure is spelled V-T-D-i-g-g-e-r. By Dan Allen
What is AJAX Programming? AJAX is a special program for updating parts of a webpage. The benefit is that tiny parts of a web page can display changes without re-displaying the parts of the page that have not changed. Re-display forces the internet to carry mountains of data it already has delivered. AJAX lets the internet say: "Update this one part of the webpage, and leave everything else still."
By Dan Allen
Ferguson and the Montpelier 650 Stephen Ferguson pays the freight, but is not allowed to drive. (Indy News Service) Stephen Ferguson grew up near the speedway. Even though he practically owns the team, team captain, Jimmy Glass, will not let him strap-on the car for a ride. By Tim Twinam, Montpelier Star
Data Bridging Bridges only go in difficult spots, whether the bridge is for G1 Endy racing or data streams. In this Montpelier Telecommunications Super Speedway photo, data bridging is set in place during a driver rest period (August 2008). In the Boston area, data bridge work like this takes place under lights at night, to avoid disrupting traffic. Montpelier Speedway road crews have the relative luxury of working in the sunlight, kept cool by Green Mountain breezes.
Moving data from one kind of software or database to another is difficult. Paste this web page, or even just a part of it, into Word, email, Excel, or almost any other program, and most likely what you get will be wild distortions of what you are looking at now. By Dan Allen
Basic Racing Skills FTP File Transfer Protocol (FTP) is our friend in web racing. By Dan Allen
Vermont Electric Running Super High Speed Broadband Over the next three years, Vermont's electric companies, through Velco and Vermont Transco LLC are installing super high bandwidth backbone for public use.