If God didn’t want us to add widgets to our websites he wouldn’t have created sidebars.
I added a Javascript call to the Twitter API to display my latest update on this site a while ago, but it slowed page load down quite a bit, so I removed it again (at least until Twitter get their scaling problems under control). I could have written some server side code to cache my latest update, but it didn’t seem worth the effort.
Then Google released the very cool AJAX Feed API this week, and I stayed up for hours playing with it. One of the many ways you can use the API is to hit Google’s more reliable servers for the latest cached version of a feed (from the same data source that Google Reader uses). So instead of accessing your feed directly, pipe it through Google and call it easily with Javascript.
To display your latest Twitter status, add these lines between your web page’s head tags:
<script type="text/javascript">
var THWX_twitter_id = YOUR_TWITTER_ID_NUMBER;
</script>
<script type=”text/javascript” src=”http://www.google.com/jsapi?key=YOUR_API_KEY”></script>
<script type=”text/javascript” src=”http://thoughtwax.googlepages.com/twitter.js”></script>
Replace YOUR_TWITTER_ID_NUMBER with your Twitter feed ID (the number in the URL of your Twitter RSS feed) and replace YOUR_API_KEY with your Google Ajax Feeds API key, which you can get here.
Then add this HTML where you want your latest update to appear:
<div id="THWX_twitter_status"></div>
Lovely. Example here.
Paula and I arrived back yesterday afternoon from our week in Morocco. It was my first time visiting a non-Western country. Get ready for some superlatives.

We rented a car and drove north from Agadir airport to the small hippie/surfer village of Taghazout, then to the walled city of Essaouira, east to Marrakesh, and back to Agadir through the Atlas Mountains.

Life moves slow in Taghazout. Most of the fishermen come ashore after a couple of hours in the morning, by which time the day has eased into its usual mix of visiting surfers and local loiterers. Beach soccer is pretty popular.




The roads in Morocco are just as interesting as the cities they lead to. The coastal views are spectacular. Indigenous Berber people line the roads, walking, standing or just squatting, watching the traffic go by. Some work in rocky fields or guide donkeys along the roadside, but mostly they sit in the shade alone, apparently for lack of anything else to do. Some wave frantically at the passing cars, smiling and holding up bottles of olive oil for sale.




Closer to the city we passed road painters and small crowds of men putting up giant red national flags, and things generally got busier. It was obvious that there was a frantic cleanup job going on, and when we got into the city we heard that the King of Morocco was arriving the following day. The whole town was buzzing in anticipation, and getting their streets and shop fronts ready.



Inside the walls of Essaouira is a maze of twisty passages (all alike), lined with markets, tea houses, workshops and restaurants, and opening out into squares and ports.




The city is soaked in bright blue.



Each night we stood on the roof terrace of our riad and listened to the final call to prayer of the day echoing out across the city from the mosques as the sun set, and each morning we looked down into the tightly packed living areas.

On to Marrakesh.


Coming from Essaouira, Marrakesh is a hard place to arrive into. After being flagged down by an aggressive motorcycle guide while entering the city and falling for the oldest trick in the Moroccan book (allowing him to guide us through insanely busy streets to his friends guardian de voiture parking area and haggling over price), we found our way to our riad.

Outside of the main tourist areas of Marrakesh you see very few Westerners, the poverty is conspicuous, and the density is overwhelming. The streets are a ballet of people on foot, bicycle and moped avoiding and interacting with each other. The culture of repair and reuse is everywhere. Any of the guys in the food markets and craft souks could teach you a hard lesson in business. It’s a real city, warts and all.



Final leg of the journey. We too took the scenic route back, up and over the snow-capped Atlas Mountains (2100m) and down the small winding road into the desert on the other side. Children on their way home from school thronged around our car if we stopped nearby and wrangled whatever sweets we had out of us, then chased us down the road. Some held up paper signs with “STOP” scrawled on them and shouted “bonjour!” as we passed.



This is a rough edit of the five hundred or so shots we took during the week, far more than I’ve ever taken before, and that was without even trying. We couldn’t help ourselves, it’s certainly the most photogenic place I have ever been to, and the visual offering is only a part of the story. Again more than any place I’ve been to, Morocco is a full sensory experience, and the sounds and smells really are something else. For every photo I took, I wished that I had a microphone with me to record the sounds.

What have I not mentioned? The incredible hospitality and openness of the people there, the amazing food, the beautiful weather… I warned you about the superlatives. The running joke of the week was a gameshow-style ding that would sound every time Paula said “so gorgeous” or I said “amazing”. Ding!

If you can take any more, there are still more photos on my Flickr and on Paula’s.
I’ve been wondering about paper cups for a while now. Is it more environmentally friendly to drink from a disposable paper cup, or to drink from a mug and then use a dishwasher to clean it?
At first I figured it must all come down to energy: does it cost more energy to produce the cup, or to clean the mug? But of course there’s more to it than that. My simple equation becomes a bit more complicated when you factor in the embodied energy* in the paper cup (that is, the total energy that was required to manufacture, transport and dispose of the cup from start to finish of its life), and try to weigh that against the potential for reuse of the mug. Then you would have to balance that against the energy cost of each mug reuse, and factor in frequency of use of each, along with the volume and efficiency of production and running… and all of a sudden my notebook is covered with scribbles and I still have no idea what to drink my coffee out of.
I couldn’t find anything conclusive online, and decided to look further. First stop, Lazyweb. A few months ago I posted my question to Yahoo Answers, but didn’t really get anything more than guesses in response.
Then I asked my friend Dom, who is actually a bit of an authority when it comes to paper cups**. She has been collecting them for years now, I think planning to one day make some sort of action-art based work out of her collection. Any time I meet up with her, she’s usually got a couple of cups that she picked up stowed away somewhere. I emailed her about cups and mugs. She said:
I have to check on the latest, but it was, as long as the dishwasher is packed to its limit each time, and it is a well designed dishwasher i.e. energy/water efficient, the mug is best.
but, as part of some new cup work in the future, I will have to re-investigate the facts.
Pretty good, but still not conclusive. I sort of forgot about it for a while.
Then today, via a mailing list I’m on, the link I was looking for for ages. Here’s the science bit:
The energy of manufacture of reusable cups is vastly larger than the energy of manufacture of disposable cups (Table 1). In order for a reusable cup to be an improvement over a disposable one on an energy basis, you have to use it multiple times, in order to “cash in” on the energy investment you made in the cup. If a cup lasts only ten uses, then each use gets “charged’ for one-tenth of the manufacturing energy. If it lasts for a hundred uses, then each use gets charged for only one-hundredth of the manufacturing energy.
But in order to reuse a cup, it has to be washed. The efficiency of the dishwasher, and the efficiency of the energy system that powers it, determine how much energy is required for each wash. Hocking assumed a new, commercial dishwasher running on Canadian electricity, requiring about 0.18 MJ/cup-wash. The total amount of energy per use is this wash energy plus the appropriate fraction of manufacturing energy, depending on the cup’s lifetime. Figure 1 shows how the energies per use of the three reusable cups decline, the more you use them.
The lifetime needed for the energy per use of a reusable cup to become less than for a disposable cup, is called the ‘break-even point.” In Table 2, the break-even matrix shows how many uses are required for each reusable cup to do better than either disposable cup.
The results are extremely sensitive to the amount of energy the dishwasher requires for cleaning each cup. Hocking’s choice for the dishwasher, requiring 0.18 MJ/cup-wash, is barely less than the manufacturing energy of the foam cup, 0.19 MJ/cup. If Hocking had chosen even a slightly less energy-efficient dishwasher as his standard, then the reusable cups would never have broken even with the foam cup.
The lesson of this life-cycle energy analysis is that the choice between reusable and disposable cups doesn’t matter much in its overall environmental impact. One should use one’s best judgement.
Which is to say, today I brought a mug to work. They’re nicer to drink out of anyway.