« June 2008 | Main | September 2008 »

July 13, 2008

Sirius XM- new name and services

Unless Mel has a brand new name (which he doesn't) let's just go simple, cheap, and not confuse people. Sirius XM sounds the best so stick with it.

Now on to some services ideas.

You know those emergency radios with the hand crank for power, the light, siren, AM/FM/TV tuner? The TV tuner is analog so you can kiss that goodbye in Feb 2009 when TV goes digital. Every TV tuning radio for the US market must be redesigned with a digital TV tuner- so don't buy the wrong model at a cheap sale this year! During Hurricane Katrina, local radio was shutdown since people evacuated and had no power anyway. Wouldn't a satellite radio with emergency power be great? The radio stays on, the big TV news stations stay on. People could get news and comforting distraction. The satellite providers have already proved that they can turn on a dime and change programming (they created Client 9 Radio in a day). This should be something the FCC wants as a merger pre-condition. A platform for a useful public service, not just more lobbying dollars spent on the FCC as they drag it out. Just take an XM boom box and add a power crank to it- voila!

More video services. Sirius has 3 channels (cartoons, since low data rate works well with them- QVGA, 250kbps, 15fps is all you need to keep kids happy. QVGA looks fine blown up on a high pixel-density 7" screen). With the merger, the extra bandwidth from elimination of redundant channels will enable many more video channels. More than they need, frankly. Hopefully they built the video player to be able to handle more than 3 channels out of the box (I'm sure they did) when more become available.

Data file broadcast service. This is where it gets interesting. Satellite broadcast can deliver music, video, or any type of data, in either real or non-real time. Imagine a satellite radio that not only could store music (like the Pioneer Inno), but that could download a city guide and have it all cached. Maps, events schedules, digital coupons, city business phone book, etc. The major metros could each have a channel on the merged entity, and the file broadcast would keep it up to date through differential data downloads. Public service plus web-like information. I don't think you can program the Inno like a VCR, but that would be a nice add, too. There are many great shows on XM that my commute schedule just does not mesh with.

The data broadcast service could also broadcast audio/music and video non-real time (such as overnight) so that you have it available for playback the next day. Like PODCasts, but only mass-market since you are broadcast to many. This would take a fraction of the bandwidth of a regular channel, allowing for multiple low-bit rate services. How about an audio book channel?

Would it be possible for Sirius XM to provide some special data services for the government? The answer is yes. Amber alerts for satellite radio plus other formats, like the CAP alert (see http://www.incident.com/cookbook/index.php/CAP_Fact_Sheet ). I'm familiar with these since I wrote the software to parse the CAP alerts coming over UHF into text messages that I relayed over SMS to Nextel cell phones. Converting it to a feed for satellite that is 'read' using text-to-speech is simple.

I see great things for satellite radio. Even slumping cars sales could be spun right (listen up, Sirius XM marketing department). If you can't buy a new car, just upgrade your old one- Duh! For less than the monthly payment on the average new car, you could have a satellite receiver, new speakers, and about a year's worth of service. That's a bargain.

July 08, 2008

California Wildfire Yahoo Pipe

The title says it all. Over 1,000 fires going on. I've updated and fixed a bug or two as well. Pretty popular pipe- over 3,000 runs to date and a few clones. It uses news feeds, flickr photos, videos, and puts them on a map. 

http://pipes.yahoo.com/erich/wildfires

If you have a good RSS news source, let me know. 

July 03, 2008

Facebook Desktop Application Development

I love Adobe AIR and am writing a desktop application using AIR that works with Facebook. One of the challenges of working with Facebook is authenticating your requests to their REST server. Below is some actionscript code that produces an MD5 hash of a Facebook API request. 

Here is the algorithm to be implemented:
 args = array of args to the request, not counting sig, formatted in non-urlencoded arg=val pairs (these are CGI parameters)
 sorted_array = alphabetically_sort_array_by_keys(args);
 request_str = concatenate_in_order(sorted_array);
 signature = md5(concatenate(request_str, secret))

Note that secret is not the Facebook application secret, but the session secret Facebook returns after proper authentication of the user!! There is an actionscript MD5 library (com.gsolo.encryption.MD5) from http://gsolofp.blogspot.com/2006/01/actionscript-3-md5-and-sha1.html that I use. Works great.

 

public static function signRequest(params:Object, secret:String):String
{
   
var hashInput:String = "";
    
//get the keys from the params associative array and add them to a new array
var keys:Array = new Array();
var index:int;

for (var item:String in params)
{
keys[index++] = item;
}
    
//sort the keys
var sorter:Sort = new Sort();
sorter.sort(keys);
 
for (var i:int; i < keys.length; i++)
{
//iterate the sorted keys and concatenate into one big string
trace(keys[i] + "=" + params[keys[i]]);
hashInput += keys[i] + "=" + params[keys[i]];
}

hashInput += secret;

return MD5.encrypt(hashInput);
}


This is not the hard part of signing a request. The bigger challenge is knowing exactly what parameters need to be sent, and that if you are using some special class or library, knowing what it might be sendiing, as well. The Facebook error messages help, but they are undocumented. That's where this blog comes in.

Below is an error response to trying to do a photo upload to Facebook using the built-in upload() method of the File class in AIR. (I did change a few values in it so the signature won't compute.)

Details:
<error_response xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <error_code>104</error_code>
  <error_msg>Incorrect signature</error_msg>
  <request_args list="true">
    <arg>
      <key>Filename</key>
      <value>kids.jpg</value>
    </arg>
    <arg>
      <key>call_id</key>
      <value>1215090174125</value>
    </arg>
    <arg>
      <key>method</key>
      <value>facebook.photos.upload</value>
    </arg>
    <arg>
      <key>api_key</key>
      <value>281b9cd2f09c077b2bb100707de</value>
    </arg>
    <arg>
      <key>session_key</key>
      <value>f6bec46c8aa0647b3f377b4440679</value>
    </arg>
    <arg>
      <key>v</key>
      <value>1.0</value>
    </arg>
    <arg>
      <key>sig</key>
      <value>6949810fb9aff86b103520760ff8</value>
    </arg>
    <arg>
      <key>Upload</key>
      <value>Submit Query</value>
    </arg>
  </request_args>
</error_response>

What's significant about this message is that it actually is telling you everything that Facebook is using to compute the signature for the request it received. The keys and values are what it recevied from your computer. Put them into the method above (except for sig, of course), and you get the signature that Facebook computed when it attempted to authenticate your request. This looks straight forward, except that the Filename and Upload arguments are not provided directly by you- they are actually being put into the request by File.upload(). Nor are they mentioned as being required parts of the request in the Facebook API, and in fact, neither Filename nor Upload are used by Facebook. But since they are sent, they are part of the request that Facebook uses to compute the signature and if the signature you send does not match theirs, your request fails.

The moral of the story is you need to know what you are really sending when doing any type of hash of CGI parameters. this affects Facebook, Amazon, and others.


Hosting by Yahoo!