Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Static RSS for new/cool/ratings

Quote Reply
Static RSS for new/cool/ratings
Hi,

For anyone who's interested, I just wrote this little script that will build .rss files for you. You may want to change the file extensions to .xml, but thats just a case of doing a search and replace of rss for xml :))

1) Edit build_rss.cgi, to replace /path/to/admin (2 occassions) to your path to the admin folder
2) Upload build_rss.cgi and CHMOD to 755 (where ever you want to upload, although the ideal place is in the admin folder)
3) Upload the .html files attached in into your templates folder (if using the luna template set for example, upload to /admin/template/luna)
4) Run the script, to test it works ok.
5) Setup a cronjob. You can set it to run whenever you want, although the ideal one would be daily - something like this should work:

Code:
0 0 * * * perl /full/path/to/build_rss.cgi

Hopefully this is of some use to someone =)

BTW: I've left the .html templates attached, so GT can look into why they won't open Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Nov 29, 2007, 1:52 AM
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
Hi Andy,
Can it be used for Dynamic pages with mod rewrite?
Quote Reply
Re: [Dorette] Static RSS for new/cool/ratings In reply to
With mod rewrite, you should be able to.

Andy - the html pages (attachments) are not uploaded above. Thanks.
Quote Reply
Re: [socrates] Static RSS for new/cool/ratings In reply to
socrates wrote:
With mod rewrite, you should be able to.

Andy - the html pages (attachments) are not uploaded above. Thanks.

Weird - looks like a bug in GForum :/ They are definatly uploaded :s

I've uploaded them as a .zip now.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Dorette] Static RSS for new/cool/ratings In reply to
Dorette wrote:
Hi Andy,
Can it be used for Dynamic pages with mod rewrite?
Hi,

Yes, but it will require a modified version (attached)

Call with:

Code:
RewriteRule new_links.rss$ /cgi-bin/links/build_rss.cgi?type=new [L]
RewriteRule popular_links.rss$ /cgi-bin/links/build_rss.cgi?type=popular [L]
RewriteRule top_rated_links.rss$ /cgi-bin/links/build_rss.cgi?type=ratings [L]

Then, you should be able to call them as these kind of URL's:

http://www.yourdomain.com/new_links.rss
http://www.yourdomain.com/popular_links.rss
http://www.yourdomain.com/top_rated_links.rss

Hope that helps

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Dec 2, 2007, 10:22 PM
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
Hi,

I've uploaded a slightly newer version to my last post. There was a bug where it was printing to WRITEOUT (normally would be the file). It seemed to work as it was, but may as well fix it while I noticed it =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
Hi,

Just for your info, I found a bug with listings that don't have standard charachters in. Its a simple template fix. Just change:

Code:
<title><%Title%></title>
<description><%Description%></description>

..to:

Code:
<title><%escape_html Title%></title>
<description><%escape_html Description%></description>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
Andy wrote:
I found a bug with listings that don't have standard charachters in. Its a simple template fix. Just change:

Code:
<title><%Title%></title>
<description><%Description%></description>


..to:

Code:
<title><%escape_html Title%></title>
<description><%escape_html Description%></description>

Hi Andy,
for german umlauts (ä, ö, ü) there is a ? shown, instead?

Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Static RSS for new/cool/ratings In reply to
Mmm..not sure :/

I'm going bed now - but will have a look tomorrow for you (no guarantees though =))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
I'm just using this line
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
instead of
Code:
<?xml version="1.0"?>
that's all Cool

Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Static RSS for new/cool/ratings In reply to
Hi,

Glad that sorted it =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static RSS for new/cool/ratings In reply to
Hm it sorted the problems not really.
The umlauts ä ü ö are shown right with
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
but google accept only sitemaps with this code
Code:
<?xml version="1.0" encoding="UTF-8"?>

With this code the umlauts are shown wrong and only as ?

Suggestions to solve this are welcome
Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Static RSS for new/cool/ratings In reply to
Check the coding of your database & what code the original data was in. Some software doesn't cope with umlauts etc. therefore when it is entered in the database it appears wrong. This is particularly relevent when importing data from a third party's data feeds.