Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

[TOOL] Links.cfg Generator.....

Quote Reply
[TOOL] Links.cfg Generator.....
For those newbies having trouble configuring links.cfg I have just made a new script that will generate it for you after you enter some basic information into a form.

It will eliminate any common errors such as trailing slashes being where they shouldn't be etc.....

You can test it out here......

http://www.perlmad.com/test/test.cgi

PLEASE let me know what you think and give suggestions as to how it could be improved.

I already have plans to modify it so you can install the script on your own server and it will auto-detect paths and the server environment and will write the link.cfg file into your admin directory automatically.

THANKS.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Overall, pretty nice tool...see that you have been applying the regular expression knowledge you've been collecting recently...

Wink

Here are some comments, Paul...

1) @db_referer should be one field that people can enter in multiple domains/ip addresses separated by commas. Also the example of including /cgi-bin/add.cgi is not good. Simply using something like "www.domain.com" would suffice. Also, you do not need the http:// in the array values.

2) You might want to add in some regexp for the sendmail path field...simply checking for the forward slash is probably good enough for most users, but may be checking for two forward slashes would be better.

3) Also, setting up the paths and urls for the New, Ratings, Popular (Cool) would be nice. Many users do not use the default values...so having this configurable would also assist users.

4) The following variables are missing in the config form:

$db_mailer_log
$build_dir_per

All the other variables at the bottom of the links.cfg...configuring file names is essential...like many users have problems with missing the file configs at the bottom of the file, which causes 404 errors.

Anyway...keep up the good work.

Regards,

Eliot Lee
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
In Reply To:
Overall, pretty nice tool...see that you have been applying the regular expression knowledge you've been collecting recently...
Smile

Thanks for taking the time to point out my mistakes and give useful advice - I will fix up the errors today and apply the changes you mentioned.

Thanks.


Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
You should let the details path/url to submitted regardless if details turned on. Also, when the script was generating the config file, all I got was the "QuickTime" logo in the center of the screen so check the header being printed.

Happy Coding,

--Drew
http://www.FindingHim.com
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Hi drew,

Ive been tinkering with the script all afternoon so you probably caught it when I was editing.......

I would be grateful if you could try again now to check it works.

It seems to be ok for me....

Thanks.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
OK, some updates since version 1.0......

Added extra options such as the choice to rename the cgi files, also the path for the mail log and the path for the headers and footers directories....oh and directory permissions.

I now have about 1,000,000 lines of regex and error checking :) - there are no doubt still a couple of ways to get around it but I'm not too worried about that as only really stupid people can mess it up :)

I am really proud of the Referers bit because the fields are entered seperated by commas but then end up as...

('www.url.com','url.com')

Yes I know it is easy enough to do but I was just pleased with myself....nuthin wrong wif dat Smile

Here is the code I used - is there a better way?


$FORM{ref1} =~ s/\s*//g;

split(/\,/,$FORM{ref1});

foreach $val (@_) {
$new .= qq|'$val',|;
}
chop $new;

Please let me know how I can improve it more.....

Im working on getting it to send links.cfg to the webmaster as an email MIME attatchment. Also working on NET::FTP transfer....




Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
I still have the 'quicktime' thing going on in MSIE5.5. When I load the program in Netscape 4.7 and Mozilla 6 and Netscape 6 I get the page source.

Happy Coding,

--Drew
http://www.FindingHim.com
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
After working on this for about 8 hours my brain is dead.....

I am almost there with the MIME email but I could do with a bit of help if someone has a minute....

Ok...when the links.cfg file is generated, it is put into an array....

So I have....

@code = qq|
LINKS CFG CODE
|;

print @code;

...then I have....

&write(@stuff);

}


sub write {
my (@stuff) = @_;

$rand = scalar localtime;
open(LINKS,">tmp/$rand.txt") || &error("Can't create links.cfg tmp file!");
foreach (@stuff) {
print LINKS "$_\n";
}
close(LINKS);
&emailme($rand);
}

.....ready for my email sub to email the file as an attatchment. To make sure there were no conflicts, each file is named scalar localtime.....eg

Thur 26 Mar 2001 13.45.txt (or whatever)

....ANYWAY...the problem is that only 1 is printed in the file and nothing else. I have encountered this before and I know it is easy to solve but I cant concerntrate and I have a headache (good excuse Smile)

Thanks to anyone who can help.

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Hmmmm thats weird - Im using MSIE 5 and it works fine.

I have had a couple of emails to tell me people are using the script and they are only sent after the code is produced so something is up somewhere..

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Duh....Nevermind about that message two posts up - Ive fixed it.....

I had

@code = print qq| |;

Instead of

@code = qq| |;

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
If anyone is listening....

I have updated the script again. When you have successfully entered all required information, the links.cfg file will be generated and emailed to you via email - then all you need to do is upload it in ASCII.......bingo!

Use it here:

http://www.perlmad.com/test/test.cgi

I have been testing it all afternoon and it works great for me but let me know if you are having troubles.....

You can totally customize all aspects of links.cfg from cgi file names to referers etc...

Hopefully some will find it helpful...

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
OK another update....

This is turning into something great Smile

Basically the script will take all the necessary info from you and generate the links.cfg file. The file will then be emailed to you as an attachment, HOWEVER there is now also the option of getting the script to automatically ftp the file to your admin directory.

This is optional as people may not want the file ftp'd into their server but it is a great time saving feature. You just fill in your username and password etc...and the script will login to the remote server and upload the customized links.cfg file into the Links2 admin directory.

Are there any more features people would like?....I would really appreciate testers and some feedback as only Eliot and Junko has commented so far.

I would like to know if I am wasting my time or not.....

Would a version that installs the whole of Links2 for you be a good idea?

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Hello Paul!!!

It seems a wonderfull tool Laugh

Good Work Laugh

See YA

Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
Ahhhh thankyou, so someone IS reading my posts Smile

Hope you find it useful.

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: [TOOL] Links.cfg Generator..... In reply to
hi Paul,

GREAT work!!

can i get this script to make an german version ?

thx in advance.

ciao
nicky
German Links Version
http://nicky.net/links
Quote Reply
Re: [Paul] [TOOL] Links.cfg Generator..... In reply to
Is the tool dead now??

I visited the site and its down
Quote Reply
Re: [spherica] [TOOL] Links.cfg Generator..... In reply to
I provided a current link in my other post:

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=270095#270095


Leonard
aka PerlFlunkie