mashTape and APIs
Sunday, Mar 30. 2008 – Category: Songbird
Hacking on my mashTape extension has been a great way to find some wicked APIs and get the extension developer’s perspective on Songbird platform development. This morning’s hacking has made me realise we need a better way to allow extensions using display panes to set context for when their display pane should be visible. For instance, mashTape makes little sense when not listening to music. I’d love to be able to set something in my install.rdf, or in my display pane registration code to the effect of:
- Don’t show when “not playing”
- Don’t show in a non-media view (e.g. when I’m browsing the web, etc.)
I’ll have to think about it a little more and writeup a story/bug to figure out how I’d like to register this context for my display pane. Right now I’ve done it in mashTape through a combination of a tabbrowser select-tab listener, and a WebProgressListener, which seems like a lot of unnecessary work.
On the topic of APIs… I love Last.fm’s APIs, but it’s frustrating that their API for getting the artist bio information is incomplete. Perhaps it’s to drive traffic to their site (which is understandable), but I often get email requests to expose more of the bio information. Looking around, Freebase has got a wicked cool API, and they’ve somehow scraped Wikipedia’s great content into a bio/article for the artist. I’d love to use it… if only I could figure out how to get the bio! I played with their APIs for at least an hour this morning, and could grab all the information for everything except the “a.k.a.” and “bio/article” sections. Ugh.
Somehow I got from Freebase’s site over to DBpedia where they’ve built XML/RDF interfaces for Wikipedia’s content, and within 5 minutes I had a successful call to grab and parse out the full Wikipedia abstract text for artist bio, years active, etc. etc. I’m psyched. Now I just need to integrate that into mashTape and I should have a full artist bio.
6 Responses to “mashTape and APIs”
Leave a Reply
Recent posts
- my first fake tilt-shift
(Tuesday, Nov 18. 2008 – No Comments) - Album reviews in mashTape
(Tuesday, Nov 18. 2008 – No Comments) - whacked gets fatty
(Sunday, Nov 16. 2008 – 5 Comments) - Songbird 1.0.0rc2 on OpenSolaris
(Sunday, Nov 16. 2008 – 1 Comment)
Categories
- Cars
- ChinaBlog
- Code
- Computers
- Food
- Football
- Grommit
- Linkage
- Movies&TV
- Music
- Musings
- OpenSolaris
- OpenSource
- Outdoors
- Pets
- Photos
- Quotage
- Songbird
- Sun
- Travel
Grommit
Mozilla
OpenSolaris
- alan burlison
- bonnie corwin
- eric boutilier
- glynn foster
- jim grisanzio
- mark nelson
- mike kupfer
- planet opensolaris
- stephen hahn
Songbird
Archives
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
- June 2003
- May 2003
- April 2003
- March 2003
- February 2003
- January 2003
- December 2002
- November 2002
- October 2002
- September 2002
- August 2002
- July 2002
- June 2002
- May 2002
- April 2002
- March 2002

March 30th, 2008 at 15:04
Good idea Steve.
What if it was easy for panes to programatically control their visibility and dimensions?
Mozilla sidebars get setSidebarWidth() and toggleSidebar() (See http://developer.mozilla.org/en/docs/Code_snippets:Sidebar)
Also, are you familiar with TabContentChange? It’s a controversial new event that makes it easy to track the state of the browser. (See http://dekiwiki.songbirdnest.com/index.php?title=Platform%26Player/Recipes/Tabbed_Browser)
March 31st, 2008 at 00:20
Try this to get the aka and article (i.e. of David Bowie):
http://www.freebase.com/api/service/mqlread?queries={%22q1%22:{%22query%22:%7B%0A%20%20%22/common/topic/alias%22%20:%20%5B%5D,%0A%20%20%22/common/topic/article%22%20:%20%7B%0A%22id%22:%20null%20%20%0A%7D,%0A%20%20%22id%22%20:%20%22/topic/en/david_bowie%22%0A%7D}}
And to get the contents of the article you will need to use our blob api with the article id you get from the above query:
http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000000013658
If you have any questions contact us at our developers mailing list.
March 31st, 2008 at 00:24
Sorry for the multi-post but another great resource is our query editor. You can try the above query here:
http://www.freebase.com/tools/queryeditor?q=%7B%0A%20%20%22/common/topic/alias%22%20:%20%5B%5D,%0A%20%20%22/common/topic/article%22%20:%20%7B%0A%22id%22:%20null%20%20%0A%7D,%0A%20%20%22id%22%20:%20%22/topic/en/david_bowie%22%0A%7D&read=1
March 31st, 2008 at 10:17
Thanks Dae - the query editor is cool, I was hoping to find a tool like that but couldn’t find it anywhere on the site. I must have missed it somehow.
Is there a way to get the entire article text? It looks like using the blob API only returns me an excerpt from the article.
June 17th, 2008 at 07:50
You legend! This is exactly what I’m trying to do with a music mashup I’m working on. I’m a big fan of MashTape, and have spent the last hour or so re-reading your javascript code for inspiration on how you did it, but this article explains all. Many thanks!
June 18th, 2008 at 01:43
[...] pictures of the currently playing artist. I was reading through the mashTape code, and then found this posting by its developer, which hepfully provided the exact method I [...]