Gossamer Forum
Home : Products : Links 2.0 : Customization :

Verifying big links databases: temporary solution.

(Page 1 of 3)
> >
Quote Reply
Verifying big links databases: temporary solution.
Hello all.

While nph-verify.cgi is still unable to deal with big link databases in browsers (lock up after 100-200 links checked) I offer a long, but working way to get a handy htm - formatted results using Telnet.

Here is complete instructions for amateurs like me:

1. Connect your server via Telnet (SecureCRT program recommended).
2. Go to your links directory:

cd cgi-bin/links/admin (in my case)

3. Start nph-verify script and tell it to store verifying results in txt file:

./nph-verify.cgi >deadlink.txt

4. Give the script a time to finish it's work (it may be a pretty long time). It's a perfect time to drink a couple of beer.

5. Launch your FTP program and enter links/admin directory. Download report file (deadlink.txt) to your computer in ASCII format.

6. Here is the best part of the trip: Open this file with Microsift Word and make a MACROS turning a plain text report to a formatted html one.

Here is how your pain text report string will look like:

1070 - http://www.some_of_checked.com/ : 500 - Internal Error

Here is how this string have to look like after applying Word macros:

<br>1070 - <a href=http://www.some_of_checked.com target=_blank> Check it </a> <font size=-1><b> [<a href=http://www.yoursite.com/cgi-bin/links/admin/admin.cgi?db=links&amp;modify_form=1&amp;ID=1070&amp;ww=1 target=_blank> modify </a>| <a href=http://www.yoursite.com/cgi-bin/links/admin/admin.cgi?db=links&amp;delete_form=1&amp;ID=1070&amp;ww=1 target=_blank> delete </a>]</b></font> : 500 - Internal Error

Apply this macros to all text strings and save this file as deadlink.htm

7. Launch your browser and open deadlink.htm.

You're done. Enjoy.

******************

It takes a while to write such a macros, but then you can easily turn boring text report to a nice html page with possibility of one-click checking/modifying/deleting dead links. Be extremely careful recording macros and double check every character you type.



Thank you.

PS. Please, don't ask me how to record Word macros. It's boring, but simpliest procedure ever. Just place your cursor at the beginning of plain report string and make all nesessary changes. To force ID number "variavle" copy the number while recording macros and then paste it after ID= in URL's . To the right navigation through plain string use Find and enter _:_ and _-_ where _ are spaces.
Remeber that error string lenght and URL lenght are vary in each report. So use only common elements, as I said above.

Sorry for such a lamer approach, but this is the only one working for now.

All professionals, please, do something with nph-verify.cgi.

Thank you.

Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Or i would imagine opening with wordpad or editplus and just saving it as .html would work. Wink
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Nope. This action will just save the same text with other extension. I'm talking about real html-formatting of the plain text + automatic adding (by macros) of special links to review/modify/delete link with the single click.


Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Kangaroo,
Oh ok, I understand now. Smile
oh, btw... http://lh.links247.net/...admin/nph-verify.cgi
Splits the pages, and uses span. You can set maxhits per page to any number you want under 100. Any number over 100 will default to 100.
Bye.
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Hi!

is it possible to download somwhere "your" verify.cgi ?

tenx

Gregor
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Ok. I took a look at your link, this script works better indeed. BUT! It also doesn't produce an html interactive report, i.e:

123 - link to 123 - [modify] [delete] : Error description.

So you have to copy and paste every URL to check it, and then manually search it in database to modify or delete dead link. This report looks exactly as the one that nph-verify.cgi writes in a file as I described in my first post.

The second disadvantage is a webmaster need to manually start every next portion of verifying. But this process is very long on large databases. I.e. I have to wait about a hour while nph-verify finishes it's job in Unix.

So I think my way is faster and more effective, after all.

There is another way: to modify nph-verify.cgi to force it write all necessary info in .txt file (I mean in Unix) instead of just typing

ID - URL : Error reason.

But my knowledge about perl is too small to do it by myself.

So your script helps to solve the "verifying links in browser" problem, but doesn't solve "handy report" problem.

Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Quote:
123 - link to 123 - [modify] [delete] : Error description.

So you have to copy and paste every URL to check it, and then manually search it in database to modify or delete dead link. This report looks exactly as the one that nph-verify.cgi writes in a file as I described in my first post.
I took off the modify and delete because of my admin mod. I could add restrictions on to those functions so I took them off. I could easily add a report or whatever, and if you type all in the maxhits field it will check every link in the db.
Quote:
The second disadvantage is a webmaster need to manually start every next portion of verifying. But this process is very long on large databases. I.e. I have to wait about a hour while nph-verify finishes it's job in Unix.
Not necessarily. With a few lines of html, i can add a meta refresh, that will increase its nh by one every time. Just like build staggered. That way you just point your browser to it. Give it a little bit of time at 20 links a pop. Browser won't time out or anything. Yours may be faster but like you said its more complicated and not everyone has telnet.
Quote:
So your script helps to solve the "verifying links in browser" problem, but doesn't solve "handy report" problem.
I can add that today. I could make it so it'll write them in a table ie. ID | URL | Error, in an html file. I will probably have to do it so it will print the date of the file like 11-05-01verify.html so it will only print once a day. It could check to see if it already exist.
Oh, i'm assume the interactive part of your way is the modify and delete on the html page, I'll do that too.
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Bmxer,

It would be just great if you'd make this mod to nph-verify. Not only me but all fat database users are praying for your success. Laugh

Please, let us know when done and where we can find the source code. Please, use this thread to inform us.

Many thanks.
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Quote:
Not only me but all fat database users are praying for your success.

LOLOLOL you may want to re-phrase that BlushCool
Quote Reply
Re: [RedRum] Verifying big links databases: temporary solution. In reply to
Ok, RedRum, thin database owners are praying too, hiding behind fat ones. Sly
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Cool
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Ok, i added back the modify and delete thing.
The report is printed and i made it so if a links is already in the report, it won't be updated.
I have to work on this a little bit.
And I added the report thing using the date.
# Edit
I'm taking the report thing off for a bit to work on this some. Not sure how i would release this as a mod. I guess you guys could just replace your current nph-verify.cgi with this one. don't know yet.
Lavon Russell
LookHard Mods
lavon@lh.links247.net

Last edited by:

Bmxer: Nov 6, 2001, 11:54 AM
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Ok, Bmxer, let's try to just replace standard nph-verify with your one. It may be will replace the script in the "classic Links distributive" one day. Blush

We're waiting for results.

Thank you again.
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
I assume if you want to just check links quickly, you wouldn't need a report. I'm making it so that if you view it regularly it won't do a report. But if you do mh=##specialword##, it will do the report. I'm doing this b/c its hard to not print the same record twice on the report if you run it multiple times. And each time you go to a new page, it adds to the report. So i figure I will make it mh=##specialword##, you could run it once a night by cron. It will do every link, and also still print a txt file that will contain the id's of the bad records. I will probably work on this some but for now this is all I can do.
Lavon Russell
LookHard Mods
lavon@lh.links247.net

Last edited by:

Bmxer: Nov 7, 2001, 11:59 AM
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Bmxer,

I've never used cron before. Hope It's not to complicate. Anyway, all you're going to do sounds good. By the way, could you change nph-verify to write .htm file with <html> and <body> tags together with bad links [modify] & [delete] tags? Then we could just download this file via FTP and lauch it in browser.

Thanks again.
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
It already does, like this,
http://lh.links247.net/...-Nov-2001verify.html
If you don't have cron, I guess it would work the same as if you only ran it using the special word to print a report once a day manually.
Edit.....
Doesn't seem to be working right now. The link will show the html page as soon as i fix this.
Lavon Russell
LookHard Mods
lavon@lh.links247.net

Last edited by:

Bmxer: Nov 7, 2001, 12:34 PM
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
Wow - you continue to outdo yourself. What a fantastic mod, just what many people have been wanting for a long time. Can't wait until it's available. Just wanted to say thank you for all the great work you do.
Quote Reply
Re: [marinedesign] Verifying big links databases: temporary solution. In reply to
Yep ... bmxer you should know that even if we don't post a message here .. we just can't wait for this mod Smile

Gregor
Quote Reply
Re: [marinedesign] Verifying big links databases: temporary solution. In reply to
Thanks... shouldn't be long now till i give this out. i will probably have to do some more fixes then test on a 1000 + link database - At least for the next hits viewing bar. I don't know how it will run on that big of a db when printing a report. i added some more features. http://lh.links247.net/...admin/nph-verify.cgi I added a main page to change max hits, or if you're going to it from the admin, max hits is already set to 10. on the actual checking page, http://lh.links247.net/...i?detailed&mh=10,
You can see up to 6 days of reports and it cuts off at a week, or whatever number you would want. I will probably add something to auto delete one that is older than the set time.
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
When I typed my first post here, I was just trying to help lamers like me to do something with "lock up" problem of nph-verify. Now I'm happy seeing how many people have readed it and post their mesages here.

Eternal law... The more you give - the more you get.

Good luck, Bmxer! Smile
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Quote:
Eternal law... The more you give - the more you get.

Except in my case it's, "the more I give, the more I get moaned at" Cool

Last edited by:

RedRum: Nov 8, 2001, 5:21 AM
Quote Reply
Re: [Kangaroo] Verifying big links databases: temporary solution. In reply to
Close to releasing it. I finally got the report building fixed. I found a bug too in the sorting. It deletes all of the reports that were made after the cutoff. The bug was that it would sort by date, but the first number. So 31-Oct-2001 wouldn't get deleted but 30-Nov-2001 would. So i fixed that. And i fixed it so if you run from the browser, max hits is set at 10 but from telnet, its set in report made and builds the report. In telnet, it doesn't print the results in html (Meaning there are no html tags, like urls or anything). It also only builds one report per day, and if you run report mode more than once. It will just reprint what you had before, unless there is a new dead link. Then it will add it. Right now I just have to clean up the code and add some stuff to the report pages. i'm just gonna release my nph-verify as a file w/o instructions. There is also some code that you would have to add in db_utils.pl. Should be out soon. Angelic
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
It's 23:30 at my home .. i'm not going to sleep ... i'll stay awake .. watch MTW music awards and wait for this mod :)

Gregor
Quote Reply
Re: [sc2utp] Verifying big links databases: temporary solution. In reply to
That makes me want to release it now, because its close, but i have to go to work now for a few hours. Should be out tomorrow. By the way, I made it defaultly use IO::Sockets, and not LWP. All you have to do to use LWP is uncomment the lines it says to though. I imagine most will keep it the way it is. Bye.
Lavon Russell
LookHard Mods
lavon@lh.links247.net
Quote Reply
Re: [Bmxer] Verifying big links databases: temporary solution. In reply to
well guess i'm going to sleep ... Blink 182 is playing at the end of mtv awards .. i have to get up early (job is not waitting).

Bmxer ... hoping for "good morning" Cool

g'night

Gregor
> >