# Parse Javascript, tag ID3 tags of MP3s problem

**URL:** <https://www.ruby-forum.com/t/parse-javascript-tag-id3-tags-of-mp3s-problem/92482>\
**Category:** Ruby\
**Created:** [April 19, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/parse-javascript-tag-id3-tags-of-mp3s-problem/92482 "2007-04-19T22:21:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 19, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/parse-javascript-tag-id3-tags-of-mp3s-problem/92482/1 "2007-04-19T22:21:58Z")

</div>

I’m a Ruby newb, eager to learn. I think I found a problem where Ruby  
might be the right “glue” for the job. But I’m having trouble getting  
started.

General Problem:  
I’m trying to tag ID3 tags of a bunch of MP3s based on data from the  
web.

Specifics:  
Web data is in javascript format here:  
[http://www.omnimusic.com/library/by\_cd/js/1.js](http://www.omnimusic.com/library/by_cd/js/1.js)  
(View that data via html here:  
[http://www.omnimusic.com/library/by\_cd/cd.html?OMCD=1](http://www.omnimusic.com/library/by_cd/cd.html?OMCD=1))

Javascript parser for ruby is here:  
[http://idontsmoke.co.uk/2005/rbnarcissus/](http://idontsmoke.co.uk/2005/rbnarcissus/)

ID3 tagger is here:  
[http://id3v2.sourceforge.net/](http://id3v2.sourceforge.net/)

I have already installed id3v2 via MacPorts and used it with success.

My thought is that I’d write something in Ruby that would use “curl”  
to get the javascript, parse it, get the data I need and run the id3v2  
command to update the ID3 tag. For example, the tempo of track 1 is  
“144”. So I will tag the Beats Per Minute tag of track 1 with “144”  
using this command:  
/opt/local/bin/id3v2 --TBPM “144” /Library/WebServer/Documents/  
Omnimusic/“om00101.mp3”

So that’s the gist of it. Now, I’m trying to get that Javascript  
parser working. I am running the example parse.rb file like this:  
ruby parse.rb 1.js

It returns nothing. So I guess that .js contains no functions? Any  
ideas?

Any help is much appreciated!
