<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>@sizzlemctwizzle
&lt;tt&gt;.getElementsByTagName(&quot;a&quot;)&lt;/tt&gt; returns a list of all &lt;tt&gt;A&lt;/tt&gt; elements, including anchors, and so will generate an error when it encounters an anchor that has no href property (though it may be that all A tags have a href property in the DOM). If you use &lt;tt&gt;document.links&lt;/tt&gt; you get only links with an href. But you are right, &lt;del&gt;there is no &quot;links&quot; tag so the script will fail&lt;/del&gt; (well I guess it took me 25 minutes to compile this). But then if you use xPath you can get an html collection that only contains rapidshare links, and so you could eliminate the regexp or have it do something more useful.

@john34516
I already made a &lt;a href=&quot;http://userscripts.org/scripts/show/13709&quot;&gt;script for this&lt;/a&gt;, which you would certainly find if you did a search, and you could comment in that script's section. It will not download the entire file (or even the error page) as would psyched's example in certain cases. I have heavily tested it and it works well, but with a couple problems yet - A large number of bad links (perhaps over 150, I'm not sure) will get your IP (apparently) blocked. I have figured out a fix for this. The script really only looks for good links, it isn't really designed to analyze bad links, I only need to know if a link is good.
Sometimes a server is down or isn't responding, this doesn't mean the file is gone, and I'm not sure if there's anything JavaScript can do about it since the timeout period is so long.
The script wouldn't post an edit to the forum, but I'm sure it could be patched to do so.
&lt;strong&gt;However&lt;/strong&gt;, this is not the right way to do that, you'd be much better off with a server-side script to do the checking, it would be much faster and more reliable. I have talked to a forum moderator that uses one of these, and he was only using my script when for some reason the server-side script wasn't working.</body>
  <body-html>&lt;p&gt;@sizzlemctwizzle
&lt;br /&gt;&lt;tt&gt;.getElementsByTagName(&quot;a&quot;)&lt;/tt&gt; returns a list of all &lt;tt&gt;A&lt;/tt&gt; elements, including anchors, and so will generate an error when it encounters an anchor that has no href property (though it may be that all A tags have a href property in the DOM). If you use &lt;tt&gt;document.links&lt;/tt&gt; you get only links with an href. But you are right, &lt;del&gt;there is no &quot;links&quot; tag so the script will fail&lt;/del&gt; (well I guess it took me 25 minutes to compile this). But then if you use xPath you can get an html collection that only contains rapidshare links, and so you could eliminate the regexp or have it do something more useful.&lt;/p&gt;

&lt;p&gt;@john34516
&lt;br /&gt;I already made a &lt;a href=&quot;http://userscripts.org/scripts/show/13709&quot;&gt;script for this&lt;/a&gt;, which you would certainly find if you did a search, and you could comment in that script's section. It will not download the entire file (or even the error page) as would psyched's example in certain cases. I have heavily tested it and it works well, but with a couple problems yet - A large number of bad links (perhaps over 150, I'm not sure) will get your IP (apparently) blocked. I have figured out a fix for this. The script really only looks for good links, it isn't really designed to analyze bad links, I only need to know if a link is good.
&lt;br /&gt;Sometimes a server is down or isn't responding, this doesn't mean the file is gone, and I'm not sure if there's anything JavaScript can do about it since the timeout period is so long.
&lt;br /&gt;The script wouldn't post an edit to the forum, but I'm sure it could be patched to do so.
&lt;br /&gt;&lt;strong&gt;However&lt;/strong&gt;, this is not the right way to do that, you'd be much better off with a server-side script to do the checking, it would be much faster and more reliable. I have talked to a forum moderator that uses one of these, and he was only using my script when for some reason the server-side script wasn't working.&lt;/p&gt;</body-html>
  <created-at type="datetime">2007-12-29T22:19:40Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">5700</id>
  <topic-id type="integer">1501</topic-id>
  <updated-at type="datetime">2007-12-29T22:26:41Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">27110</user-id>
</post>
