Archive: October, 2007

del.icio.us proxy v1

April 2, 2008: version 1.1 released.

A little while back, Ian Lloyd mentioned that he could not save links to del.icio.us because the site is blocked at his workplace. So, I wrote a proxy using PHP.

What does it do?

The proxy allows you to save bookmarks to your del.icio.us account without going to the del.icio.us site itself.

So, why is that useful? Say you’re at work and your friendly IT department have decided that de.icio.us is an evil distraction and must be blocked to save the company from going under. You still want to save bookmarks to your del.icio.us account and this is where the proxy comes in.

Once installed, the proxy sits somewhere on your own website – which is hopefully not blocked as well – and waits patiently for you to send it a bookmark. It will save the bookmark to your del.icio.us account for you using an interface kindly provided by the folks at del.icio.us (their API).

So, the proxy saves your bookmarks to your del.icio.us account by proxy, hence its name. Obviously, the del.icio.us service must be available in order to use the proxy.

Download and install

Download del.icio.us proxy

That link also takes you to the installation instructions. The proxy is fairly easy to install, even for people with little PHP knowledge. You just set a few things and upload it to an area of your site.

Once installed, it’s a cinch to use. It’s not been tested extensively in the wild yet, so consider this version a beta release. Having said that, Ian says he’s been using it for a little while with no problems, so I figured I’d finally release it for others to use.

I hope people find it helpful. Enjoy!

Notes

After some initial theatrics with throttling, writing a proxy was quite straightforward. To begin with it seemed that, despite sticking to the API rules about not querying the server too often, querying del.icio.us from my domain had been permanently blocked.

Having discussed my intent and my code with the friendly del.icio.us support team, I’m assured that this shouldn’t be a problem. However, thanks to a tweet from Shiflett, I coded in some extra protection against being throttled.

If you do get throttled by del.icio.us while using the proxy, I suggest you get in touch with del.icio.us directly to sort it out quickly.

Thanks

The proxy uses the PhpDelicious library written by the lovely Ed Eliot. Thanks Ed.

The idea to check for the del.icio.us account’s last update time before posting to it came from Chris Shiflett. Ta Chris.

The inspiration for the proxy in the first place came from Ian Lloyd. Cheers, m’dear.

Updates

April 2, 2008

Version 1.1 released with important fixes.

December 6, 2007

Version 1.0.1 released with annoyance fixes.

Looking forward to Fullabrook

I’m looking forward to visiting the Fullabrook Down wind farm. It should be ready by 2010, provided the plans don’t get scrapped.

The site in North Devon received the go ahead from the government last Tuesday – 22 wind turbines generating around a third of North Devon’s electricity.

Local views

I think most of us will agree that wind farms are no magic bullet. I’ve always considered them to be just part of a larger solution. But wind farms have caused quite a stir in North Devon, as can be seen by the last time I wrote about wind energy.

North Devon is such a beautiful area. It’s my homeland and I love it. I’d hate to see anything ruin it. However, I just can’t relate to the more vocal locals who write in to the papers to spout on about the devastating, horrific things that will happen due to wind turbines. It’s as if these wind turbines getting the green light means the world is going to end.

The letters in the local papers often seem hyperbolic, even vitriolic. They instil an inherent cynicism in me, so I have grown tired of the debates. Of course, that’s my problem and I expect people will pick me out on that. Anyway, I don’t necessarily think the people who write in are stupid, ignorant or even wrong. But I see figures buzzing about their comments that are never backed up with solid sources. I see letters of opinion quoted as evidence. I don’t question the legitimacy of the feelings such letters express, but their weight as factual evidence. Just as I don’t expect my opinions in this very entry to change anybody else’s view, none of what I read against wind farms sways my opinion.

Something I find odd (and frustrating) about the whole wind debate is how seemingly outnumbered I am by people who are strongly against wind energy. The local anti-wind groups seem far more impassioned and more vocal than those of us that are pro-wind energy.

Local consequences

One of the main concerns of locals is the impact of the wind farm on our primary industry; tourism. Quoting Nick Harvey, our local MP, via the North Devon Journal:

Mr Harvey added that the tourist industry is worth £500 million to North Devon and Torridge and any decrease in income would create a whole [sic] in the local economy.

I wish I had the power of foresight to be able to support or play down those concerns, but I don’t. I don’t propone to have the answers.

I’ve commented before that I stop and watch wind turbines if I get the chance. I can remember a few specific times I’ve stopped or wanted to stop when passing a wind farm: there was one farm we passed in Cumbria (Lambrigg); the lone turbine just off the M25 near junction 20 (the Renewable Energy Systems office at Kings Langley); the one at Green Park off the M4 near Reading; the three turbines at Forest Moor; the new farm at Avonmouth, Bristol. Am I the only person who finds wind farms calming and beautiful to watch?

In a previous entry about Batsworthy Cross, I wrote:

At the EcoTech Centre in Swaffham, they have a turbine that you can go up in and see the view from their viewing platform. […] I think such a viewing platform would be a fantastic addition to the area, for example, at a good viewpoint such as Batsworthy Cross.

Viewing platforms could be a great feature at Fullabrook too. One or more turbines with viewing platforms. I’m sure that the views across North Devon would be astounding, and even the most ardent NIMBY would begrudgingly have to take a trip up to the top of one.

How about a centre to teach visitors about leading a more sustainable lifestyle? I think an “eco-centre” would fit well into the ethos and essence of the area. (One of the things I love about North Devon is how localised some things are, especially food. You can get fresh produce from local sources daily and many of the restaurants and pubs are locally sourced.)

Perhaps the Fullabrook Community Fund could contribute towards such developments or help boost tourism in the area in other ways?

I can understand that the development period of the turbines will entail problems for the people who live nearby. I can’t understand people getting put off their annual pilgrimages to North Devon because of a wind farm.

Further reading

Your views

Having experienced a barrage of comments about wind energy the last time I blogged about it, I’m tempted to turn comments off for this one – it’s only my opinion after all – but sod it… let the comments flow freely!

CakePHP 1.2: config for the console

I hope readers will forgive yet another fleeting entry from me. My Internet connection has been unusually unreliable for about six weeks and since Monday it has been disconnecting around ten times a day. Eugh.

In other news, I’ve been using CakePHP recently. So far I’m finding it pretty good. It’s all starting to come together, but the somewhat distributed documentation makes Google my best friend for development right now! I’m finding some useful little bits as I go, so I thought I’d share things as I discover them.

Setting up the new console in CakePHP 1.2

I found it easy enough to set up the console. One of the first things I did was watch some of the screencasts, including one on setting up the terminal to run console shells from the command line. No problem. But…

Problems connecting to the datasource

I hit a bit of a problem when I wanted to play with the Access Control List (ACL) component. The console couldn’t access the database when I tried to set up the database tables:

cake acl initdb

It had the correct details from the database config file, but it just wouldn’t connect. Specifically, I was getting this

Can't connect to local MySQL server through socket '/etc/mysql.sock'

Grr. The website connected to the database fine when browsing. Hmmm. MySQL seemed to be behaving. Double hmmm. I began thinking it must be a permissions issue somewhere.

Nope, it turns out that localhost hadn’t been resolving to my local IP address. Putting in the IP (127.0.0.1) as the database host fixed everything. I’m guessing that command line PHP, or at least my installation of it, doesn’t do name lookups.

Huge thanks to the lovely and wonderful lornajane for helping me track down the problem. This saved me for some additional pain on what has already been a painful week! If this little nugget helps you too, feel free to comment and say thanks to Lorna with me!