Google
You could also try tk Social Bookmarking Search or tk Video Search!

Saturday, August 12, 2006

Mp3Tunes Fast script

2 comments Backlinks

Firefox version
Opera version

After the Mp3tunes script, I wasn't very impressed with the speed of it. In fact, I was sure that the code was going very slowly, so I decided to see what was causing it. So after looking at it for 10 - 15 min, I finally realised that it would run approx 1/2(n+n^2) or n/2(1+n) times, better known as the formula for the summation of an A.P. starting at 1 and ending at n. Obviously, this was not an ideal implementation as I've first hand experience of Firefox locking up on pages with a quite a bit of mp3s. Opera doesn't lock up, but it still takes a while to populate the links with those sideload icons.

So I took matters into my own hands and wrote the scripts above, which run a lot faster than the scripts by Mp3Tunes. And by faster I really do mean that the difference is great. You may not see much difference with 10 links, but 50 links or so should do the trick. There are around 50 "mp3" links below, try it with the old and new scripts, I'm sure you'll see a difference.

Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3
Fake mp3

Categories:
Cool

 

Friday, August 11, 2006

Mp3Tunes Greasemonkey script for Opera

Comments Backlinks

I've been playing around with Mp3Tunes for quite a while now and webloading mp3s is quite irritating. You need to copy the url and paste it into the webload form. Yeah it seems simple at first, but when you do it often enough, it becomes a chore to do those repetitive and mundane tasks. There is a plugin from Mp3Tunes available to make that easier, but it's only available for Firefox. What a bummer!

So after seeing a digg post about a script that embeds a flash player to autoplay mp3s on webpages, I was inspired to make this script. Well, I thought of making it earlier, but procrastination held me back till today. There are some things you should know though.

First, I spent only an hour making this script. That includes testing, reading code, etc. I know it should have been faster but apparently pasting in the base64 code of the image into the address bar of opera gives you nothing after pressing enter. Clicking that exact same code in the form of a link loads the image. It left me wondering if my base64 code was correct!

Anyway, this is not really my script since I didn't write most of it. Whoever made the script for Firefox did the hard work. I just ported it over to Opera by changing a single line. :) That line is simply the sideload image file converted to base64 encoding. Originally I wanted to base this script off other similar mp3 scripts, but after reading a couple, I wondered if I could port the Firefox code and got it working after a few tries.

Second, this script works quite slowly on webpages with tons of mp3s, like maybe above 200 mp3s. The good news is that it doesn't hang Opera and you can wait for it to finish loading while working on other tabs. The bad news is that it may take a min or 2 to load entirely.

Well, that's about it. I hope you enjoy using this script. Btw, I only tested mp3 and wma files. But the other supported formats should work as well as the original script. :)

Update: I added a Firefox version here.

Categories:
Cool

 
Google
You could also try tk Social Bookmarking Search or tk Video Search!