Tag Archives: javascript

Using Javascript to Populate Forms During Development

During development, working with forms quickly gets annoying because you have to constantly fill in each field, sometimes with unique info. One way around this is to write a little Javascript code that just populates the fields. I use something like this on the bottom of the form. I had jQuery no-conflict mode on in this case. In your app you might be able to get away replacing _j() with $():

<% if ENV['RAILS_ENV']=='development' -%>


<% end -%>

Fetching Lots of Small Files from RapidShare? Tip to Save Time

I was staring at the 30+ RapidShare tabs I have open, annoyed that I had to keep waiting for the countdown timer before starting each download. The problem was that I kept forgetting about the countdown and the downloads altogether (30 second timer + Geek-ADD… impossible). It literally took me 10+ hours to get one file just because the session kept expiring.

Some Greasemonkey scripts helped a bit, but I don’t like keeping Greasemonkey enabled just for 1-2 tiny scripts that aren’t that useful anyway, nor restarting Firefox (which I’d need to do to re-enable it). I also don’t really need a solution that’s 100% automatic because I’m usually on the PC when I’m downloading these files, so a little manual work isn’t a problem. A premium account would be fine, but I don’t trust RapidShare with my payment information. I don’t know what other information they store (I emailed them, see reply below) . It’s like giving BTJunkie (good people) your name and address before you’re authorized to download torrents. It’s 100% safe, but just makes me feel uneasy. Even though my downloads are public domain. Warez is BAD NEWS, like Weed or premarital sex.

So I just kept refreshing the site and viewing the source hoping that something useful would magically appear, sort of like when I’m hungry and keep opening the fridge, even though I know there’s nothing interesting in it because I checked it a few minutes earlier.

A lot of older scripts and hacks don’t work because RapidShare now (actually it has been a few years) does most of its auth stuff server-side instead of using Javascript. The following tip is useful in some cases. It isn’t a “hack,” and wouldn’t work when downloading big (10MB+) files. It works great for me because I use RapidShare to download ebooks, scripts, and other not-so-big files (usually 1-10 megs each).

RapidShare displays a countdown timer with a duration that depends on the size of the file. Files about 500KB or less have no countdown, while files up to ~30-40 megs have a 30 second countdown. Bigger files have a 50-60 second countdown. I’m not sure of the exact numbers, but you get the idea. After the countdown is done, the page reloads with a unique URL to download the file. This URL expires after some time, but …

Countdown Can Be Started on Multiple Files Simultaneously

When the countdown is active on a file, you can click “Free user” on other RS links you have open, and the link to download each of the other files (the big DOWNLOAD icon) remains active for awhile. If you can finish any downloads before this time expires, you can begin the other downloads using this link, without having to go through the countdown again.

So this basically saves having to wait the 30 seconds. That’s it. You can’t download more than one file simultaneously when you aren’t registered, but by having all the download links ready to go, you can begin each download as soon as the prior download has finished.

I’m not sure when the download link expires, but the time seems to have increased to at least a few minutes. Unfortunately, download speed is capped at around 70-80 KB/s on free accounts, but in my experience this still works great (I DL at the max speed).

Note, clicking “download” when another file isn’t complete will give you a warning that your IP is already downloading another file, and you must now refresh – meaning you must wait for the countdown again.

Usual Scenario

Pamela has 9 tabs open - Normally, she would have to click “Free user,” wait for the countdown timer, and then DL… and when done, click the next tab and repeat the process.

But now, she can get some of that work (waiting) out of the way – She clicks “Free user” on the first file. 30.. 29.. 28.., … while she waits for that to reach zero, she goes through every other tab, hitting “Free user.”

Now ALL her RS tabs’ countdown timers are going down, and when finished, they will each redirect to the page featuring the download button. After the first download is done – Pamela just goes to the next tab and clicks “Download” and the next download instantly starts. No waiting.

And so on. Again, this wouldn’t work with big files (or anything on a slow connection) because by the time you have finished downloading one item, the other RapidShare download sessions will have expired.

You can squeeze more time out of the session by waiting till the first countdown is almost done before activating the rest. This can give you a 20-25 second headstart. If the session(s) do expire, you can just repeat the process, preferably starting with smaller files first. Also, this might differ depending on time of the day, as RapidShare’s limits are changing throughout the day. I.e., rush hour, happy hour, etc.

I don’t use RapidShare.de, just .com. If you’re tried this on .de, be sure to report your results.