Gossamer Forum
Home : Products : Links 2.0 : Customization :

Embed Random Link via SSI on other pages

Quote Reply
Embed Random Link via SSI on other pages
Hello all,

I was wondering if it is possible to somehow use the random link function, and embed a random page link via SSI in other pages outside of the links area.

It would need to be more than just an actual link to the random script ... I was thinking more along the lines of calling the random script, then embedding either the title of the resulting link, or any other information associated with it (for example, I added an image field to my link database, so perhaps just a linked image is embedded on a page).

Any suggestions on how to approach this?

Thanks,
Sin

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
This may be a start......

http://gossamer-threads.com/perl/forum/showflat.pl?Cat=&Board=L2Cust&Number=137959&page=0&view=collapsed&sb=5

You will need to change the database name and pick a random link from it but you should be able to find code for that in the forum/resources area.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
I got one even better.

How about calling a random link from a remote URL? For instance, if I have several sites, all different, but I'm looking to create traffic among my sites, I might show a link from Site 1 on Site 2 and display it as "Hey, here's a sample of what we have over on Site 1!"

Thanks.

DT

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
Hmm not sure about that.

This may be a sloppy way but hey Smile.....

Use Net::FTP to get the database from your other server so it is up to date, then pull a random link from the database and call it into your page using SSI if you want. Then delete the database every week so it is kept up to date. You can then use -e in the script so it will only use Net::FTP to transfer the file if it doesn't already exist, but if it does it will select the random link.....eg....

if (-e, "link_db_2.db") {

Pull the random link

}
else {

FTP it from the other server so it is kept up to date each week

}

Did that make any sense?

I'll try to come up with a quick eg if you want....?

EDIT:
ALTERNATIVELY, use LWP to perform a search for a random word on one of your other sites and select the first link and display it on your other site...



Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
http://cgi-resource.co.uk/pages/randlinks.shtml

Posted this a while back, think it should do what you want. It works but there's likely to be better/more efficient ways of doing it (I wanted to redo it and make improvements but haven't got round to it yet.).

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
It won't do what dogtags requires though....

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
Thanks for the script, Glenn, I'm going to give it a shot later on today.

One more question: is it possible to have this random feature be more specific, for example, it only randomizes, say, new links, or popular links, or links with the highest ratings?


-- Sin

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
 
I haven't yet tried Glenn's random link script, but say DT runs this script on one site, and generates the random page there. Is it possible to then just call this page via SSI at his other site?

For example, he generates "random.html" on www.site1.com. He then calls this page from his other site:

<! -- #include virtual="http://www.site1.com/links/random.html" -- >

[I've only used SSI within a site, I've never tried to include stuff from one site to another, so I don't know if this will even work]


-- Sin

Quote Reply
Re: Embed Random Link via SSI on other pages In reply to
Yes but he'd still have to have a copy of random.cgi on each server to get the link from the database so you are back to the same situation.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: [PaulW] Embed Random Link via SSI on other pages In reply to
Hello,
i got this problem when running glennus script:
http://satellitehit.virtualave.net/cgi-bin/randlinks.cgi
i changed to full path but still getting this message.
HelpLaugh

Loucian