Archive for the Technology Category

PHP Script for parsing inbound email and saving attachments to a web host

Posted in Social Networking, Web Programming with tags , , , , , , on July 18, 2008 by webzealot

Ever wondered how BrightKite, TwitPic, and some of these other Web 2.0 websites have managed to reverse engineer email?  It used to be that websites would send YOU email, but that’s not all that exciting anymore.  Newsletters, notices, and alerts generated by web scripts are pretty common in even the most mundane of websites.

The trend recently has been to flip email on it’s head.  Now people can email (or send SMS text) to a specific address, and the contents of that message can be instantly parsed and posted on a website.  Particularly intriguing to me was the ability of a site like BrightKite or Flikr to save an attached image, more or less instantly, and have it post to the web.

That got me to wondering… How are they doing that?

As a long time ASP coder, I could see lots of trouble ahead.  In the world of Windows hosting, there are some very wide chasms between web services, and email services.  I asked around, looked high and low, and tinkered.  To make a long story short, I don’t think there is any way, or at least any good way, this functionality can be implemented through ASP.  I could be wrong about that, but I sure couldn’t find even a hint of a way to do it.  If I’m wrong, I would love if somebody could please respond and set the record straight.

What I did find is that this is NOT the case in the world of Unix and PHP!  In fact, PHP has many very nice tools to bridge the gap between email and web hosting… Many of these nifty toys can be found at the PHP.net website.  So, I dove in and started playing!

What I came up with was the following script.  To give proper credit, the main function (called “parsepart”) was originally written by some fellow in the UK named John… That’s all I know about him, and his script is posted on the PHP.net site along with others.  I did modify his script in a few spots, specifically in decoding the file name of any attachments.  But this script is a foundation for doing what TwitPic, Flikr, FaceBook, and others are doing.  I looked and played long and hard to come up with this… I hope somebody else can benefit from it as well…  Also, this doesn’t handle SMS, just email.  SMS is a task for another day!

<?php
//script will fetch an email identified by $msgid, and parse its parts into an
//array $partsarray
//structure of array:
//$partsarray[<name of part>][<attachment/text>]
//if attachment- subarray is [filename][binary data]
//if text- subarray is [type of text(HTML/PLAIN)][text string]

//i.e.
//$partsarray[1][attachment][filename]=filename of attachment in part 3.1
//$partsarray[1][attachment][binary]=binary data of attachment in part 3.1
//$partsarray[2][text][type]=type of text in part 2
//$partsarray[2][text][string]=decoded text string in part 2
//$partsarray[not multipart][text][string]=decoded text string in message that isn’t multipart

function parsepart($p,$i){
global $mbox,$msgid,$partsarray;
//where to write file attachments to:
$filestore = ‘[full/path/to/attachment/store/(chmod777)]’;

//fetch part
$part=imap_fetchbody($mbox,$msgid,$i);
//if type is not text
if ($p->type!=0){
//DECODE PART
//decode if base64
if ($p->encoding==3)$part=base64_decode($part);
//decode if quoted printable
if ($p->encoding==4)$part=quoted_printable_decode($part);
//no need to decode binary or 8bit!

//get filename of attachment if present
$filename=”;
// if there are any dparameters present in this part
if (count($p->dparameters)>0){
foreach ($p->dparameters as $dparam){
if ((strtoupper($dparam->attribute)==’NAME’) ||(strtoupper($dparam->attribute)==’FILENAME’)) $filename=$dparam->value;
}
}
//if no filename found
if ($filename==”){
// if there are any parameters present in this part
if (count($p->parameters)>0){
foreach ($p->parameters as $param){
if ((strtoupper($param->attribute)==’NAME’) ||(strtoupper($param->attribute)==’FILENAME’)) $filename=$param->value;
}
}
}
//write to disk and set partsarray variable
if ($filename!=”){
$tempfilename = imap_mime_header_decode($filename);

}
$partsarray[$i][attachment] = array(‘filename’=>$filename,’binary’=>$part);
$fp=fopen($filestore.$filename,”w+”);
fwrite($fp,$part);
fclose($fp);
}
//end if type!=0
}

//if part is text
else if($p->type==0){
//decode text
//if QUOTED-PRINTABLE
if ($p->encoding==4) $part=quoted_printable_decode($part);
//if base 64
if ($p->encoding==3) $part=base64_decode($part);

//OPTIONAL PROCESSING e.g. nl2br for plain text
//if plain text

if (strtoupper($p->subtype)==’PLAIN’)1;
//if HTML
else if (strtoupper($p->subtype)==’HTML’)1;
$partsarray[$i][text] = array(‘type’=>$p->subtype,’string’=>$part);
}

//if subparts… recurse into function and parse them too!
if (count($p->parts)>0){
foreach ($p->parts as $pno=>$parr){
parsepart($parr,($i.’.’.($pno+1)));
}
}
return;
}

//Open the connection to IMAP server
$mbox = imap_open(“{your.emailserver.com}”, “your@address.com”, “password”)
or die(“can’t connect: ” . imap_last_error());

$status = @imap_status($mbox, “{your.emailserver.com}INBOX”, SA_ALL);

//$message_to_read = imap_uid($mbox, $status->uidnext – 1);
$msgid = $status->messages;

if ($msgid == 0) {
die(“No messages in inbox.”);
}

//fetch structure of message
$s=imap_fetchstructure($mbox,$msgid);

//see if there are any parts
if (count($s->parts)>0){
foreach ($s->parts as $partno=>$partarr){
//parse parts of email
parsepart($partarr,$partno+1);
}
}

//for not multipart messages
else{
//get body of message
$text=imap_body($mbox,$msgid);
//decode if quoted-printable
if ($s->encoding==4) $text=quoted_printable_decode($text);
//OPTIONAL PROCESSING
if (strtoupper($s->subtype)==’PLAIN’) $text=$text;
if (strtoupper($s->subtype)==’HTML’) $text=$text;

$partsarray[‘not multipart’][text]=array(‘type’=>$s->subtype,’string’=>$text);
}

$header = imap_fetchheader($mbox,$msgid);
$obj = imap_rfc822_parse_headers($header);

//And heres the header info… Store it in a database, display it, whatever you like…

echo “Subject: ” . $obj->subject . “<br>”;
echo “From: ” . $obj->reply_toaddress . “<br>”;
echo “Plain Text: ” . $partsarray[‘not multipart’][‘text’][‘string’] . “<br>”;
echo “Text: ” . $partsarray[1][‘text’][‘string’] . “<br>”;
echo “Attachment file name: ” . $partsarray[1][‘attachment’][‘filename’] . “<br>”;

//here you can respond back with a confirmation email to the sender…
$headers = “From: fromaddress@email.com”;
imap_mail ($obj->reply_toaddress,”Thanks for posting!”,”Your message was received!”,$headers);

//here we delete the message once parsed, clean out the mailbox, and close it all up…
imap_delete($mbox, $msgid);
imap_expunge($mbox);
imap_close($mbox);
?>

I’ll be the first to admit I’m a bit of a PHP hack, and there may be better ways of doing this… But this script, in fewer than 150 lines, seems to do the trick!

A Nifty ASP Function to Convert a Regular URL into a TinyURL

Posted in Technology, Web Programming with tags , , , on May 14, 2008 by webzealot

I was pretty intrigued when I noticed Twitter will automatically convert a “long” URL into a “TinyURL” (see http://www.TinyURL.com if you’re not familiar with this) so I assumed TinyURL.com must have some sort of open API for automatically converting a URL.

Well, there might be an open API, but I sure couldn’t find it!

However, I figured there had to be a way to query against TinyURL.com and get the desired result. So, I wrote my own little script to do exactly that! This uses classic ASP and the XMLHTTP object:

function GetTiny(URL)
if instr(URL, “tinyurl.com”) = 0 then
preText = “<input type=hidden name=tinyurl value=”””
postText = “x = document.all.tinyurl.createTextRange();”

strFrom = “http://tinyurl.com/create.php?url=&#8221; & URL

Set xml = Server.CreateObject(“Microsoft.XMLHTTP”)
xml.Open “GET”, strFrom, False
xml.Send
sHTML = xml.responseText

strFirst = InStr(sHTML, preText ) ‘ Start of data
strLast = InStr(sHTML, postText) -20 ‘ End of Data
TinyURL = Mid(sHTML, strFirst + len(preText), strLast-strFirst-len(preText))

set xml = nothing

GetTiny = TinyURL
else
GetTiny = URL
end if

end function

To invoke it:

call GetTiny("http://www.websiteURLtoShorten.com")

Just that simple! Hope somebody finds this useful! Please let me know if you see any ways this can be improved!

UPDATE: I did discover there is an API for TinyURL… However, I have found it to be problematic. For instance, only “www.” domains seem to work, and adding “http://&#8221; onto the URL will generate an incorrect TinyURL. My script seems to work regardless.

Is Your Local Radio Station an Endangered Species?

Posted in Technology with tags , , , , , , on May 12, 2008 by webzealot

I am neither an early adopter of new technology, nor a laggard. I’m probably somewhere in between. I don’t have an iPhone… yet, but probably will buy one when my current cell phone contract runs out. I’m a little bit late and slow with the whole social networking stuff on the web. I’ve had a portable GPS for a number of years, but I don’t have HDTV. So I suppose I am pretty average when adopting these new technologies and ideas.

So if I use myself as a technology barometer for the average American, I need to wonder… Is traditional radio dying?

NPR logoHere’s what makes me wonder. Rewind a couple of years to 2006 or so. I was a fanatical NPR listener. It was the first preset on all my radios. It was on my clock radio that woke me up. I turned it on in my kitchen as I made coffee and ate breakfast. I listened in the car on the way to work. I turned it on at work (or streamed it live, a service offered by my local station). I listened on the way home. All in all, I probably listened to AT LEAST six hours of my local NPR station each and every weekday. And some days, that might climb to eight hours or more.

To say NPR was a regular part of my day was an understatement. I gave money every pledge drive… As much as I listened, how could I not? And for me, the fact that it was NPR is neither here nor there. It could have easily been any of the commercial stations in town. I just preferred NPR. And it was this listening pattern which defined my usage of radio for probably the better part of ten years.

But now it’s 2008, and boy have things changed. My local NPR station is still in my clock radio, and I still wake up with it. But when my clock radio cuts off after ah hour, I’m done. From six plus hours to one or less over the course of two years. So what’s different?

The first thing that changed was in Christmas of 2006. My wife got me Sirius Satellite radio. I had been skeptical of satellite radio. In a day and age when we seem to get nickel and dimed to death, the notion of another monthly fee or service was not terribly appealing. I already pay plenty for cable, cell phone service, Internet access, on and on… But, there I was, radio in hand. So I decided to give it a try.

In just a matter of days, I was hooked. “Subscription fee? Who cares?!?!? This is sooooo worth it!” I said to anyone who would listen. And, even better, I could still get NPR content! What’s not to love!

I got a desk top radio, but it also came with a car adapter. I could listen both at home and when driving… And that’s what I started doing. I loved scrolling through all the channels and seeing what was out there. And there was plenty. All kinds of music, talk, and sports sports sports. In fact, it was the sports programming that really got its hooks in me. We have a nearby station that carries ESPN Radio, but it’s AM which in my book is essentially unlistenable except in extraordinary situations. With Sirius I was able to listen to ESPN Radio with crystal clarity for the first time ever. And listen I did. Pretty much every morning. The watershed moment was when I had to hop in the car and didn’t want to miss anything, so I took it with me using the car adapter. My local NPR station had been formally supplanted.

I still switched back to the local NPR station occasionally, but I found myself seeking out the same programming on the satellite, just because I could. I can’t really explain that part other than to say I was just in love with the technology I guess. So in fairly short order, my local NPR station was getting my ear maybe two and half hours per day. Still a lot, but not nearly the six plus hours I used to listen.

But the switch to satellite radio was only the beginning. In the summer on 2007, I bought my first iPod. Okay, I am a laggard in that category, I admit. I don’t feel the need to listen to my own personal soundtrack wherever I go, so the whole iPod rage hadn’t appealed to me much. But, we bought one and adopted it as part of our modest home entertainment set up. But what I discovered soon afterward was PODCASTING. Oh glory be! I know podcasting is nothing new… But as I looked through the iTunes store at all the free podcasts available, I couldn’t believe it. And I could store an INSANE AMOUNT of content on my 80GB iPod. So I started subscribing to EVERYTHING, even stuff I knew I might not listen to for months.

And there, amongst it all, was the same NPR programming I was getting from the local station. Except now I could time shift… I could listen to “Fresh Air” or “Wait Wait Don’t Tell Me” or “Car Talk” when it was convenient for me. So in less than a year were two sea changes in how I listened to my local radio station.

I don’t mean to be singling out NPR here. I think the same applies to all radio. For me, local music channels have been essentially unlistenable for year. Here in Charlotte, most of our stations are own and operated by Clear Channel Communications, so they all sound about the same: Ads for car dealerships occasionally broken up by short injections of seemingly generic music.

But for the first time in years I chose not to contribute to my local NPR station. I felt a little bit bad about that, but only a little. When I was listening all day long, my contribution seemed worthwhile. Now it no longer did. Most of what I could hear over the airwaves was now available with no strings attached via podcasts.

I am a sample size of one. But lately I can’t help but wonder how many others are out there like me, and how many others will follow. I suspect I am pretty typical. There will always be some people who will hang onto the old ways as long as they can. There are still people out there using Windows 98 just because it still works for them and why change. My Mom didn’t have cable until just a couple years ago, even though it had been available to her for years. And there will still be people who stick to local radio just because they don’t know any better.

But that pool is likely to shrink, and will that be a pool affluent enough to support local radio? Is that a pool that advertisers will want to reach? I suspect not. Is radio the next thing to join newspapers on the media scrap heap?

And what of HD radio? I wonder if this was the technological advance that is supposed to save radio. But I have yet to hear HD radio, or even see one on a store shelf. Nor do I know anyone who owns one. I’m sure they are fabulous, but unlike HDTVs which seem to be popping up at all my neighbors houses, I don’t see any huge buzz over HD radio. So from what I can tell, it’s dead on arrival. Quick, give me one compelling reason to buy one…

I’m waiting…

Time’s up. I suspect if the government mandated a switch to HD radio, as it has with HDTV, many folks would simply choose to listen to their iPods instead. Just a hunch.

So I wonder, how much longer will our local radio stations be viable? AM has found a niche with talk and sports radio, but is essentially wasted bandwidth as far as I am concerned. The radios in our cars seem to deliver only marginal AM reception, as do most of the radios in our house. FM delivers far superior quality, but commercial radio is programming is as poor as it’s ever been, and with so many other alternatives how will it compete?

So I have to ask… How much longer will radio be around?

BrightKite: Privacy be Damned!

Posted in Social Networking, Technology with tags , on May 7, 2008 by webzealot

If you’re being stalked by a former spouse, or lover, or coworker, or if you are a celebrity, you can pretty much stop right here. BrightKite is NOT FOR YOU.

If you’re not being stalked, then read on… maybe.

BrightKite(http://www.BrightKite.com) is another of the myriad of Web 2.0 social networking aps that seem to be popping up on an almost daily basis. But, its unique spin is its attempt (at least theoretically) to put folks in direct physical contact with each other by tracking them through the use of Google Mapping technology.

Hmmmm… make sense to you?

Like some of the other fairly recent networking sites, it is very dependent on mobile phones, specifically the ability of its users to “check in” via SMS or email. Checking in involves self reporting ones location… Whether that be the name of a state, a city, a ZIP code, or even a specific street address.

People who are following you can then see your last reported position plotted on a map. Yeh, pretty cool I suppose. And, if you are so inclined, you can then upload a photo of your location, or otherwise post a message. And I suppose if you are really inclined, you could go and actually meet up with other folks nearby. But let’s not get too crazy here… That would involve actual HUMAN interaction.

And here, in this one site, is the manifestation of the dichotomy that is today’s Internet user. In an age where many people claim to be very, very concerned about their privacy, comes a website that asks you to divulge what is potentially some very personal data… Namely your exact location on the face of the earth at any particular time.

Pretty amazing.

Now mind you, you can choose varying levels of location information you reveal, and that can be pretty vague. So if you report your location as “New York City” that’s still going to leave a lot of ground to cover. And there are additional privacy settings that can block the information from people other than those in your circle of friends. But still, as I play around with BrightKite, I can’t help but wonder… “Do I REALLY want people to know where I am?”

I’m not sure how I feel about that to be honest. I can see where it might be handy. Suppose you are taking a road trip and you want friends or family to know what sort of progress you are making. Okay, that’s pretty cool. But what if you are sitting at home, just kicking back with the family… Do you really want just anybody to be able to locate you? That’s a little unsettling in my book. And I’m not even being stalked or running from the mob. At least not that I know of.

Then again, I suppose there is always the possibility of throwing somebody off my trail. I could check-in at Boca Raton, Florida, just for giggles. But then that brings up another point. If you are concerned enough about privacy that you only give BrightKite your approximate location, then really what is the point?

I am looking at BrightKite with a skeptical eye, very similar to the way I first looked at Twitter. But I do think BrightKite might be a harder sell for the daily user than Twitter. It seems like one of those “Hey, look what we can do” websites but with rather dubious real-world use or value. At least not yet.

But, I’ll keep an open mind about it while I’m hanging out in the 28277 ZIP code. As far as you know.

Why the Airbus A380 Will Be a Flop

Posted in Airlines, Civil Aviation, Technology with tags , , , , , , , on May 7, 2008 by webzealot

Okay, let me just set the record straight… I’m not any sort of aviation expert. Not by a long shot. I build websites, tinker with my old car, enjoy my kids, love my wife. I am totally unqualified to make prognostications about the airline industry. I am just a guy that likes to look at airplanes, particularly airliners. To me, there is no machine more impressive that an airliner. I love them, have since I was a kid. I consider myself lucky to live under the flight path of a fairly large and busy airport.

That disclaimer out of the way, the one thing that seems just as plain as the nose on my face is this: The Airbus A380 will go down in history as one of the biggest industrial flops of all time. It is the right airplane, but at the wrong time.

Okay, before all you airliners geeks (and I use that work with respect, as I count myself as one) jump all over me screaming “You’re just a jealous Boeing backer, arrogant American, etc etc” let me just point out I don’t have a dog in this fight. I dig airliners. I don’t care who builds them, or where. What blows me away is seeing all that metal, all that weight, and hearing that huge rumble. It doesn’t matter to me what flag is on the label.

The A380 is an impressive machine. Just the sheer size of it, and those four HUGE engines, pumping out the power. How can you not be in awe of that. And yes, it is bigger than the icon of the jet age, the Boeing 747. So Airbus can lay claim to being the king of the skies.

But is the A380 the result of corporate hubris? Was this Airbus’s way of challenging Boeing to whip it out and compare? Yeah, maybe. They win that contest, but why? And at what price?

All of this started back in the dark ages of the 90’s. Boeing and Airbus were battling it out to see who would sit atop the pile in the world of airline manufacturing. Both companies were looking at the future of the Very Large Aircraft (VLA) segment of the market. Boeing was already well established with the 747, but Airbus felt there was room for growth. With McDonnell-Douglas and Lockheed getting out of the jumbo jet market, Airbus wasn’t going to let Boeing have the VLA segment without a fight. And while they were at it, why not make something even bigger?

Boeing looked at stretching the existing 747-400 into a proposed 500 and 600 series. But, Boeing had trouble generating enough interest to support the additional investment needed. Even after scaling back their plans to develop the more modest 747X, airlines still weren’t nibbling. Boeing analysts decided that the VLA market was shrinking and that even modest revisions of the existing 747 platform would be hard to justify. In 2000, Boeing announced they were shelving further VLA ventures beyond the 747, and instead would shift their focus to the ill-fated Sonic Cruiser and further twin jet development.

However the folks at EADS, the parent of Airbus, seemed to read the tea lives in the exact opposite way. Airbus formally approved the A380 project in late 2000, based on a perceived market need for anywhere from 1200 to 1700 aircraft in the VLA segment. Initially Airbus said they expected to break even at around 270 units. Despite the fact that Boeing couldn’t generate interest with it’s well established plane, Airbus chose to look the other way.

In fairly short order, it began to appear that Boeing may have been right. Sales of the 747 were slowly but surely trailing off. In fact, in 2000, 747 deliveries had dropped to nearly half of what they were just the year before. Of those, only a handful were passenger models. In fact, the last passenger carrying 747s were ordered in 2002. The remainder of the 747 order book was for freighters. Airlines, ceding to passenger demands and economics, were discovering it was better to fly smaller “twin jet” aircraft several times a day on high density routes, rather than a big jumbo just once or twice a day.

Some of the trail off in 747 sales may have been a direct result of Boeing’s announcement to not further develop the aircraft.

It hadn’t always been this way. When the 747 hit the market in early 1970, it opened up affordable air travel to legions of people. Despite the huge plane’s thirst for fuel, the seat-mile costs were extremely favorable. Boeing delivered nearly 100 747s that first year. Through the 70’s and into the 80’s, 747s also criss-crossed the skies of the domestic US, connecting major city pairs.

In the 1980s came airline deregulation, and the economic environment began to change. Fuel prices rose, and as airlines were increasingly free to set their own schedules, many airlines suddenly found themselves operating huge, but half full, airplanes. Mirroring the 747 order book, was the 737… A small, but very economical twin jet. As 747 orders slowed into the 80’s, the 737 order book exploded, as did the new and larger 757. Airlines realized that it made more economical sense to fly three or four 757s on the same routes that might have once been serviced by one or two 747s.

As the 1990s rolled around, the 747 was quickly disappearing from US domestic service. By the time Airbus gave the green light for the A380, only two US airlines were still operating the 747, United and Northwest, and only on long haul international routes. But maybe Airbus didn’t really care about the domestic US market. Maybe they were looking at the global picture.

The thing is, the same economic realities were also at work overseas as well. Airbus had introduced the fuel-efficient A330, a high tech and long range wide body aircraft. Boeing was selling the 777, another fuel frugal twin jet which could still hold roughly three quarters as many passengers as the 747, but with half the number of engines. Now airlines could easily cross the Atlantic or even the Pacific, with smaller but more efficient aircraft.

So why build a big four engine airliner at all? Well, it turns out the one market that could still use a big sized jet, were the cargo carriers. While passenger 747 sales dropped to virtually nothing, sales of 747 freighters continued to be strong. Unlike the fickle passenger business, the cargo haulers have the benefit of being able to fly on more of an as-needed basis, and of being able to charge rates that are realistic. The economics of freight defy the economics of moving people. So maybe, just maybe Airbus could make this big monster work as a freighter. And in fact that was part of the plan.

Airbus cited the the same low seat-mile costs that originally made the 747 such a hit back in the 70s. Sure, it would use a lot of fuel, but it can hold so many people that it will easily make sense, right?

So now, seven years since the go ahead for the A380 was given, what does the future hold? Boeing has since announced the newest version of the 747, called the 747-8. Boeing still believes the future of the 747 is as a cargo hauler, although a few passenger models of the 747-8 have been ordered. More significantly is the explosion in the twin jet market. Demand for the Airbus A330 remains as strong as ever, and the new A350 will build on the inherent efficiency of the twin jet. Likewise, the world awaits the much delayed delivery of the first Boeing 787 Dreamliner, as new versions of the 777 continue to set new records in range and efficiency.

Also in the intervening years, fuel prices have climbed and climbed some more. Airlines around the world have struggled. Belt tightening is a matter of survival.

In 2007, Airbus put a hold on the A380 Freighter after delivery delays caused FedEx to cancel its order. Airbus chose instead to focus on the passenger version of the plane. As of this writing, there are 192 firm orders for the A380. Airbus has since moved the break-even point to 420 units, and then recently to another higher but undisclosed number. In order to meet its projected sales target of 1200 planes in 20 years, Airbus needs to sell an average of 60 planes per year. In the eight years the plane has been available for sale, Airbus has averaged 24 per year. Thus far in 2008, it has sold only three. Add to that the fact that Airbus is compensating airlines for late deliveries (nearly two years behind schedule) and the effective “real” numbers are even lower.

Dubai-based Emirates has ordered 58, but it is rumored that Airbus is essentially giving them five of the planes for free in an effort to keep the order on the books. Interestingly enough, the cash rich Emirates, and other middle-eastern airlines like it, don’t have the same economic concerns. Their oil rich clientèle tend to not shop for price, so an inefficient airplane isn’t as big a problem. Excess fuel costs can be easily passed on.

All told, at the current pace, Airbus will build fewer than 500 A380s in the plane’s 20 year life cycle, a very bleak prospect. But, that’s only if things stay as they are. If anything, the outlook is only going to get worse.

Here’s where my “I’m no expert” analysis kicks in. Sure, the seat-mile costs of the A380 might be terrific, but only if it’s full. You can put as many as 823 passengers on this colossus, although the more practical number is 525 in a three class configuration. So if you fill the plane, terrific! You have no worries. But what if you DON’T? With a barrel of oil at around $120, a gallon of Jet-A now costs somewhere around $5.40 per gallon. That means filling up an A380 can cost over $400,000. Granted, these planes will always carry only the amount of fuel needed, but it demonstrates a point: This plane is VERY EXPENSIVE to fly, and likely only to get more expensive. So can you really get 525 butts in the seats each and every time?

Maybe you can, but your exposure to loss is high. If your A380 is only 90% full, that hurts you a lot more than if you are flying the route with an A330 that’s only 90% full. Or even better, fly TWO 95% full A330s giving your customers the choice of two different departure times. Seems pretty simple. It’s about the same number of people, but in more economical aircraft and with more scheduling freedom. Even in initial costs, an A330 costs less than half the cost of a single A380. But everyone knows the real cost of an airliner isn’t the initial price, but in the fuel it will use over its lifetime. And the A380 is going to use A LOT.

If we were comparing airliners to cars, the A380 is an SUV. It holds a lot of people, and if you are splitting gas money seven ways when you go to the beach, an SUV makes sense. But around town, that SUV will bleed you dry. You and your spouse could commute together in your SUV, or you could drive two Toyota Corollas more economically and you could both come and go to and from work as you please. A simplistic example perhaps, but it illustrates a point. In today’s energy thirsty world, smaller is better.

A number of years ago I made a posting on a popular aviation website message board that I thought when the dust had settled, Airbus would end up only producing 100 or fewer A380s. Needless to say, I was resoundingly badgered by folks claiming the number would likely be at least 1000 and more likely 2000 plus. I readily admit my posting was more for sensationalist purposes, but as of the middle 2008 my prediction doesn’t look to be all that far off.

Now news is coming out that Airbus may delay the delivery all but five of the Emirates A380 order, as well as four to be delivered for Etihad. Emirates has made rumblings about cutting back or canceling their order before, but most likely just to get Airbus to dance a bit. But this time might be different. Emirates is now saying it is taking a serious look at the only A380 competitor, the Boeing 747-8 Intercontinental. If Emirates cancels, or even trims their order, the impact for Airbus could be catastrophic. With these additional delays, many airlines will be taking delivery of an airplane that is no longer on the cutting age of technology and fuel efficiency. Will other airlines start to reconsider their orders? I suspect they will.

Meanwhile, development of the A350 lags as Airbus continues to pour resources into its behemoth. The A350 is the direct competitor to the high tech 787, and promises to be a very popular plane. Popular that is if Airbus can actually deliver it.

So Airbus may be on the brink. Do you continue to pour resources into a plane with a very dubious future, or cut your losses and focus on high efficiency twin jets? Boeing seems to have made the correct call on the subject, while Airbus may have very well mortgaged its future. Either way, the magnificent A380 seems destined for the dustbin of aviation history.