The Cavern Links Checker

By yah Last update Jan 19, 2012 — Installed 2,001,390 times.

How to include TCLC in a website ?

in
Subscribe to How to include TCLC in a website ? 8 posts, 3 voices



Lithium User
FirefoxMacintosh

Hi everyone,

I found yesterday this amazing script and I would like to add this script on my website to check links automatically without greasemonkey. I tryed linking the script on my page like that :

But the script is never called. I'm really bad in Javascript so I don't really know what to do...

Could you help me ?
Thank's

 
yah Script's Author
FirefoxWindows

Lithium,
..
It would be possible, I think, to do what you want, but there might be a better solution. Remember, Javascript = Client-side code, PHP/ASP/Ruby/etc = Server-side code. Is Javascript really the best tool for the job you describe? If you just want to embed the script, it would be moderately to extremely difficult. You would have to reverse engineer the functions that Greasemonkey provides.
..
If you want your site to do Link Checks on its own, there are a whole bunch of details to consider like: how often it checks links, what does it do with good/bad links, does it make sense to do this on the server-side versus the client-side.
..
There are advantages and disadvantages to having the server do the checking. Servers can be fast, but when a lot of users are performing a check, servers can become choked. Clients are generally slower, but the script allows the checking to be distributed out amongst all clients. The more users doing checks, the faster the process becomes. Client-side checking scales very, very well.
..
If I was going to have my site do link checking, I'd probably use PHP to do this. PHP has a very good set of functions and libraries to do tasks like link checking. Javascript is very limited in what it can do. Link checking does not necessarily lend itself well to Javascript. There are limitations. Greasemonkey brings several good functions to Javascript that make link checking a good deal more usable.
..
I would become familiar with Greasemonkey and all its functions before making the decision to do what you say. Also, PHP though similar, is a learning experience much deeper than Javascript.
..
Hope this helps,
yah.

 
Lithium User
FirefoxMacintosh

Hi yah,

Thank's for your answer.

I totally agree with you concerning the technology to use. Php is probably better because of the server-side. However, javascript could be easier to use for me if I could provide Greasemonkey function... TCLC performs a lot of check (rs, megaupload, and co), it's easy to check rapishare links with their API but more difficult for the others.

In any case, I have to think about how often it checks links and if it's really usefull to check links posted a long time ago for example ...

Could you explain me how do you check links in your script (except for rapidshare) ? I'll code it using php.

Thank's a lot once again for your help :)
Lithium

 
yah Script's Author
FirefoxWindows

Lithium,
..
The process, in a nutshell is:
1. Send an HTTP request out for the URL represented by the link.
2. Response is stored as a text string.
3a. Response string is compared with a match string that matches live page or
3b. Response string is compared with a match string that matches dead page.
4. Links style is changed to reflect it being a live or a dead link.
..
It is sort of an art coming up with good match strings to compare the links with . I originally used plain text strings but I've moved to using regular expressions. Javascript seems to process regex searches faster than plain text.
..
Hope this helps,
yah.

 
Lithium User
FirefoxMacintosh

Thank's Yah for your answers, I'm going to code that using your process.

Thank's for all once again !

Lithium

 
yah Script's Author
FirefoxWindows

No problem, Lithium. Good luck on your site.
..
yah.

 
sugar0 User
FirefoxWindows

Hi, had you luck with this Lithium? Awesome script yah :)

 
yah Script's Author
FirefoxWindows

Thanks, sugar0.
..
yah.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel