aidy3
what's this?
This web application provide API to analyze ID3v2 tag in MP3 on the web. This API returns title/artist/album/genre via json/html format. Analyzed data can search with Google Base.
howto
- rule
- http://aidy3.buffr.org/get?url=[uri_encoded_mp3_url]&ref;_url=[uri_encoded_page_url(blog entry page contains link to mp3)]&format;=[html or json]
- get as json
- http://aidy3.buffr.org/get?url=http%3A%2F%2Fexample.com%2Fdummy.mp3 http://aidy3.buffr.org/get?url=http%3A%2F%2Fexample.com%2Fdummy.mp3&callback;=foobar
- get as html
- http://aidy3.buffr.org/get?url=http%3A%2F%2Fexample.com%2Fdummy.mp3&format;=html
- refer analyze result as html
- http://aidy3.buffr.org/entry/http://example.com/dummy.mp3
- search
- /serach (see also: JavaScript Tutorial - Google Base Data API - Google Code)
restriction
- ID3 version2 only
- support only ID3v2 because using HTTP Request with "Range:bytes=0-5000" header.
- ID3v2 Tag size
- 0-5000byte
sample
- Yahoo! Pipes
- Page to Podcast (bookmarklet) / aidy3 search podcast / fix podcast entry title with aidy3 / id3
- Google Base
- you can search tracks on Google Base and get information via json feed.
- Perl
- WebService::Aidy3 / Plagger::Plugin::Filter::Aidy3
- Python - scrape ubu.com and print id3 data
-
import time, re, urllib, urllib2, simplejson aidy3_get_url = 'http://aidy3.buffr.org/get?url=' re_mp3 = re.compile(r'"(http://[^"]+?\.mp3)"') req = urllib2.Request('http://www.ubu.com') res = urllib2.urlopen(req).read() links = re_mp3.findall(res) for link in links: link = urllib.quote_plus(link) link = aidy3_get_url + link req = urllib2.Request(link) res = urllib2.urlopen(req).read() track = simplejson.loads(res) print "\n".join([track['title'], track['artist'], track['album'], track['genre'], track['url'], track['ref_url']]) time.sleep(1)