My Blog of Japan Japan!

Posts Tagged Programming

DePo Clean Theme - Modifications and Reparations

I started using the very elegant wordpress theme DePo Clean from yesterday. It’s a nice sparse spartan theme with not too much busyness and I liked it the minute I saw it. There were a few teething problems with it which it took a while to fix. Here’s some of the bugs I found.

The first [...]


Textmate and the Flashing Menu

I love using the mac text editor, Textmate. It’s fast, has a great interface and looks good. The tabbed interface is a real bonus too, i can keep a few files open and switch between them by typing ⌘-1 or ⌘-2, up to ⌘-0, the same as in Firefox. Unfortunately, every time I switch file, [...]


Writing Screen Scrapers - Grab iPod Shuffle Prices from Around the World

A screen scraper is a program to get information from websites without clicking a lot of pages and cut’n’pasting from each of them. It’s a way of automatically picking the stuff you want from a site and putting it all into one place for easy consumption. For example, if you wanted to know how much [...]


Posted
7 October 2007 @ 3pm

Posted In:
PHP, Programming

Writing Screen Scrapers - Extract Information the Painless Way

Recently I’ve been thinking a lot about screen scrapers. I wanted a quick way to get lots of information from websites, one in particular, so that I could add it to my maps without all the bother of actually doing any work.
The first one I tried was called Solvent. This is a plugin for Piggybank, [...]


Setting size and zoom level of maps

What I though was going to be an easy case of looking through the google maps API for a solution to bounds turned into a mammoth task today. I wanted a way to make the centre and zoom of a map change according to the points it contained, with the centre being the average of [...]


Using LIMIT statements in MySQL

To get the front page images, I used a LIMIT function in SQL. something like this:
SELECT * FROM places ORDER BY add_date DESC LIMIT 0,6
And use these results to query the database again and grab the main photo details.
Easy, I thought. They I realised that sometimes a place doesn’t have a photo to go along [...]


Programming zoom levels and fitting points

Last week I started adding content to the front page. In PHP, I programmed a script to pull the latest 6 places from the database, grab their main photo and display it with a link to the page. I also grabbed the coordinates for each place and put them all on a map. The general [...]