check if Rapidshare links are alive or dead and make them clickable. with firefox
Extra caution is recommended when installing recently
uploaded/updated scripts (read more)
Be sure you trust any scripts you install
RS_LinkCheck
Rapidshare link parser / checker v2.3
When activated parses RS, lix and rapidsafe text URLs, then checks .de and .com links on the current page.
- Bugs in v2.2 -
If you installed version 2.2 prior to Mar 10, 2008,
the script may have added some useless entries to your prefs
file.
If you used the Preference Manager and hit the Apply button in that
version, then you should uninstall the script making sure to check
Also uninstall associated preferences. Then just
install the script again. Version 2.3 will notify you if you need
to do this, or you can reset the preferences yourself.
A Check for Update button is added to the preference
manager, so you can check for an update whenever you want. It
also tells you the version you are currently using. There are some
bugs when you try to check more then 150 links, I'm aware of the
problems and I'm reworking the code. I never download that many
links in one sitting anyway.
The link-checking status box.
Indicates total, good and bad links checked. Updates in real time.
Notifies you when you have reached the link-checking limit.
The Preference Manager form.
Change your preferences at any time by selecting the
RS_LinkCheck preferences User Script Command.
Useage
Parse and Check Rapidshare links
To activate on the current page, press - Shift+R
You may need to click anywhere on the page first.
Parse text URLs, create A links
only.
To activate on the current page, press - Shift+A
Open Selection in new tab
To activate on the selected text, press - Shift+S
Preference Manager for changing options.
You can use the menu item...
Tools -> Greasemonkey -> User Script Commands... ->
RS_LinkCheck preferences
to set your preferences.
You can change the activation key to any other
key, or any character code greater than 9. An upper case
letter requires using shift.
RS members should not need to disable direct downloads to use this script.
Features
- Converts plain text URLs to hyperlinks.
Press - Shift+A to activate this function.
It looks for rapishare, lix.in and rapidsafe.net in the page text, then converts them to links.
De-munges links like "hxxp" and attempts to fix very long broken links.
It tries to preserve the original text, while providing you with a working link to the actual RS file.
Adds a tool-tip message[linked], adds a "_blank" target, and in most cases will remove click handlers on these links (needs testing). - Changes some "redirect" links to a link of the actual file.
- Checks RS links for existing files.
Press - Shift+R to both create hyperlinks (the above) and activate this function.
Adds a green + after good links. This is done with the CSS :after selector.
Adds a tool-tip indicating the file size in bytes, see screenshot above.
lix and rapidsafe links are replaced with the RS file link whenever possible. - The link checking status is shown in a transparent box at the lower-right corner.
- Skips duplicate links, these are marked with a blue *.
- Links that return a "file deleted" message are marked with a
gray ?.
The script checks for the Content-Type: text/html header which indicates the file isn't there, or some other message. The message isn't checked, the page body isn't asked for but part of it is sent anyway, see below.
lix and rapidsafe pages are parsed in order to get the RS link, if it cannot be found then the link is marked with the gray ?. - If the RS server returns any error code (numbers above 400),
nothing happens and the link isn't tagged at all. I have never seen this happen, but their servers do
sometimes go down.
Rapidsafe and lix aren't checked for a "200 OK" response, I will likely fix this if it becomes a problem. - This script works even with "Direct Downloads" enabled. But just in case that fails it only requests the first 2 bytes.
- Will open a selected text URL in a new tab.
Press - Shift+S to activate this function on a selection.
Useful for viewing URLs that aren't hyperlinked, like image previews. For example, drag the mouse over this:http://userscripts.org/forumspress Shift+S, and it will open that link in a new tab.
This feature tries to remove spaces and line breaks, so thatuser scripts.orgwill work as well (which makes it useful to Linux users too). - You can change the activation keys and the check limits in the
preference manager.
Select the RS_LinkCheck preferences User Script Command.
When you hit Apply, these settings are saved and take effect immediately.
Debug mode is not saved, see below. - Links have class names added so that you can change the way
they look using Stylish and/or UserContent.css or in the
script itself...
.rs_linkcheck_goodfor good links.
.rs_linkcheck_badfor bad links.
.rs_linkcheck_dupefor links that have already been checked.
.rs_linkcheck_linkedis the span tags that wrap the text that was parsed into links. - The checked links info box has an ID so you can style it
differently.
I used this to set the font size...
#rs_linkcheck_info { font-size: 8pt; } - The preference manager box has it's own style sheet as
well.
If you need to you can set the size in that with something like this...
#lc_preferencesBox { font-size: 10pt; }
.lc_preferencesInput { font-size: 8pt !important; font-family: monospace !important; }
It is sometimes necessary to use!importantas in the example.
Installation
This is a Greasemonkey user script. It relies on functions specific to Greasemonkey.
To install in Firefox; Install the Greasemonkey extension
To install in SeaMonkey; Install the
Greasemonkey-Mod extension
Make sure the Monkey is smiling then click the
Install this script
link.
See also:
Greasemonkey Manual: Installing
Scripts.
To uninstall go to:
Tools -> Greasemonkey -> Manage User Scripts...,
Select RS_LinkCheck,
Check "Also uninstall associated preferences",
Then click Uninstall.
See also:
Greasemonkey Manual: Manage Dialog
And also: The
Monkey Menu
To update this script just Install the script again - no need to
uninstall.
Note: Anytime you install a script, it goes to the
bottom of your list. You can, however, drag it back up towards the
top in the Manage Dialog.
Notes
Version 1.0 first uploaded on November 8, 2007
Nothing happens when you press Shift+R?
I have noticed that sometimes nothing happens - you need to click
on the page somewhere, especially if you have just used a menu
item. This isn't a bug, it's just because focus moved off of the
page and you need to move it back. Tab works too.
If it still doesn't work try changing the key or adding a modifier,
see The Preference Manager below. It's also possible that it's not
finding any RS links on the page.
Duplicate links are not checked
If a link has been checked or is already being checked, it is
simply marked as a duplicate. I want to know which links are
duplicates, and I thought it better to not bother with checking
them (even though the browser probably
caches the link status).
Also, these duplicate links are not added to the total count.
Link checking limit and delay
If you hit a number of bad RS links, the script may stop working. I
believe they have a "max requests per second" setting and I don't
know what the number is. If you run into this problem, wait for
them to unblock you (try opening a RS link), try changing the limit
and delay, and make sure you wait for all the links to be
checked before checking the next batch. The script is not idiot
proof, that's too much work for me.
Error pages and "link status unknown"
The script doesn't check why the file is not found,
because frankly, I didn't expect to be able to and I really don't
care anyway. However when I checked for
responseText it seems part of the error pages
are returned anyway.
This means that every bad link downloads 3570 bytes
(need to verify the exact
number), which is fairly insignificant.
Navigation Bar links
If you have a Site Navigation Bar, as in SeaMonkey, you
can look under More -> rs_linkcheck for info on the
number of links checked, and also a link to this page
rs_linkcheck -> RS_LinkCheck - help page. I noticed
that in SeaMonkey this menu item doesn't update unless you switch
tabs back and forth. Link toolbar items are added but not updated
or removed until the tab is changed.
The Preference Manager
The preferences are never stored until you hit the Apply
button. The script looks for them every time a page loads
(no way to avoid that except to disable it
in the script), but if they aren't set the
script's defaults are used.
You shouldn't need to reload the page after
changing your preferences,
however some items won't update to reflect those changes if you
don't, such as the link limit message or a second tab using the
same script.
The key stored in the browser config is the Unicode value of the
charCode, a number, not
the key letter itself.
The modifiers apply to all keys, I think that's obvious.
Hey! If you forget which key-combo you picked, just open the
Preference Manager and then click on Cancel.
Be careful which key combo you pick, that they aren't used
for something else. For example Ctrl+Shift+R will reload
the page, so you wouldn't want to use that combo.
Debug mode
This script has a "debug mode" that can be used to diagnose
problems. Messages are written to the JavaScript Error Console, and
can easily be turned on and off.
The debug mode option shows up in the preference manager, and if
you enable it, then the next time you press a key it will write a
whole bunch of messages to the
Error Console. These messages may not be helpful if
you are not familiar with the script, but odd messages might clue
me in to a problem. I wouldn't use this on
a page containing a large number of
links!
This preference is not saved, so
when you reload it defaults to off. It can be permanently enabled
by
editing the script.
Disable this script?
I tried to make this script do as little as possible when it's not
being used.
Still, it has to do some and the code is loaded on every
page.
I would suggest limiting the
included sites or
disabling the script when it isn't needed.
Beware: Automat1kkk exposed a problem with having
other "Link Checking" scripts enabled. As I mentioned above, when
you install a script it goes to the bottom of your list, so if you
have a lot of scripts you may not see this one or mistake
another one for this script. You should disable or uninstall
scripts you don't use, including this one (see Installation above).
Secret feature...
If you add the file protocol (file:///*) to the included sites,
then open a text list of URLs, this script will convert all HTTP
URLs to active links, and check all RS links.
Internet Download Manager
If you use IDM this script may cause the IDM download dialog to
pop-up. In that case there is an option in IDM...
Don't start downloading from the following sites
Add the site: http://rapidshare.com/files/*
Also add "RAR" in the file types, and any other types you
want such as "ZIP", so that when you click the link the IDM
dialogue window will open up.
RS members should not need to disable direct downloads to use this
script.
Thanks to rohanmishra for helping me solve this problem.
You don't need to edit this script
More importantly: You don't need to upload this script to
edit it. If you want "smileys" you can simply use
Stylish as I mentioned above. If it
doesn't work for you then ask someone. Stylish 0.5.5 also works
with
SeaMonkey.
Here is the code to change the + to smileys using
Stylish.
.rs_linkcheck_good:after { content: " :)" !important; }
.rs_linkcheck_bad:after { content: " :(" !important; }
Note the use of !important which is often
necessary (see stylish Known issues).
I tested this and it works. It will continue to work if you
re-install this script, and I won't change the class names. If you
edit this script then any updates I make will erase what you
did.
If you want to edit it, then
make a copy and change the @name and @namespace, that's
all I ask, well, credit is always nice.
Thanks. I think I'll quit typing in this box.
resource: www.rsfind.com
插入表情