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

Building static files, xml, opml

Quote Reply
Building static files, xml, opml
Use situation 1:
My users want XML. Hence, I (they) use the xml_feed=1 a lot. It would be nice if most of the xml-files were static files. Category-based feeds, new links, and perhaps more.

Use situation 2:
My users want more XML. Since XML is not just XML, the xml_feed=1 feature is not enough. I have created seperate template sets for other feeds. For example, OPML. Each kind of XML can then be formatted in its own fashion, and I can offer a variety of feeds.

One problem I have is that I get a lot of requests for "files"; that my OPML-feeds are served up as .opml files, for example. My host doesn't allow me to do server-based redirects, so I need actual files. (unless someone here knows futurequest, and knows of a way to actually (and legally ;-) do redirects there)

The PageBuilder plug-in doesn't seem to be able to do the job.

What can I do?

John
PS: If anyone wants to chat about OPML, let me know Wink
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
Well if it is just a few files - an easy fix could be to use a cron to write the files once a day or when needed.



Klaus

http://www.ameinfo.com

Last edited by:

klauslovgreen: Jan 11, 2003, 9:21 AM
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
Hi Klaus,

I'd be interested in easy fixes, but here goes the dream machine version:

It's the same discussion as we've had about static vs. dynamic HTML-pages, where my conclusion is that it does make good sense to build static pages. Times have changed, and now we need to create not just .html files, but also a number of XML-files, such as .rdf, .rss, .opml, .rsd, and not least .yaa (yet another acronymTongue).

I think the way MovableType works with regard to building files is neat. There you can control things such as which files to build in categories, for individual pages, in indexes, etc. So, if I create a new template for using YAA (say, my OPML-feed), I just tell MT to build .yaa-files for, say, all my categories.

This should be able to do in some nice way in Links SQL too, and I'm sure it can. For now, I'm however happy to take any quick-and-dirty way to create my .opml files for GotzeLinked. One for each category to start with. And maybe one for the new links.

John
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
Hi,

I have succesfully used Cron for a number of syndications - are you familiar with cron jobs?

So place something like the following in cron or if there are many - use a shell script and just run the shell script via cron.

/home_path/cgi-bin/search.cgi?query=*&catid=57&sb=ID&so=DESC&xml_feed=1 > /home_path/www/feeds/filename.xml

There are probably better ways with Links - but this worked for me.

Klaus

http://www.ameinfo.com
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
I would think that the PageBuilder plugin should be able to do the job.

Suppose you want to have an .opml file for every category. You can just define a new 'category type' page, and set

'build directory' => whatever you like
'build filename' => <%CategoryID%>.opml

This will build files 1.opml, 2.opml, etc. in the category you specified. Alternatively, you could also have your .opml files built in the actual category directory. In that case you would need to set

'build directory' => <%Full_Name%>
'build filename' => myopmlpage.opml

BTW: With the pagebuilder plugin you can build any kind of file on your webserver --- at least as long as the file contains ascii text. So you can build xml files, opml, txt, php, css and so on.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
In Reply To:
PS: If anyone wants to chat about OPML, let me know Wink

I'm interested in this! :)
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
I tried it - but get:
No page identification specified.

What am I doing wrong?

I try to call the page using:

/page.cgi?page=pda&g=1940 (the category id)

I have set the following in page builder:

Page ID 13
Page Type Category

Page Name pda
Page Title AME Info - Mobile
Parent Page Root
Page Root 0
Breadcrumb Type Simple

Page Condition
Meta Description
Meta Keywords
Build Static Yes

Build Directory
Build Filename <%CategoryID%>
Display Dynamic Yes

View Permissions Everybody

File Type HTML

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
Try
Code:
page.cgi?page=pda;category=1940

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
thanks Ivan, Got it!


Klaus

http://www.ameinfo.com

Last edited by:

klauslovgreen: Jan 12, 2003, 5:59 AM
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
Is it not catid rather than category?

Last edited by:

Paul: Jan 12, 2003, 5:56 AM
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
Ivan,

How can I make it list only 10 links per page? Currently it lists all links in that category?

I made a <GT::Template::dump> and mh is set to 10 - but it seems pagebuilder ignores it? Any ideas?

Klaus

http://www.ameinfo.com

Last edited by:

klauslovgreen: Jan 12, 2003, 6:46 AM
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
I solved it by looping links and using
<%if row_num < 10%>

Is it by design that mh is ignored or?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
It looks as if the category pages list all links, and that the mh tag is not taken into account..... for the time being your solution is the best.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
Ok Ivan,

No problem - sometimes it is probably an advantage to get all links in a category.

If you plan a new release at some point - it would be nice is a user inserts <%next%> then you take mh into account and use the pagebar otherwise list all links - that would give the most flexibility.

Cheers
Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Building static files, xml, opml In reply to
The next release will certainly include this. I will be a while, though, before the next version is released.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
OK, I decided to give PageBuilder a try. I am having problems finding the best way to build my OPML files. These are currently created by a template:
http://slashdemocracy.org/...l&d=1&t=opml

So, how do I get PageBuilder to build a page based on the templates?

I tried changing the .tplinfo to { inheritance => '../opml' } but that didn't seem to make any difference.

I particularly want to build OPML-lists of links in categories, and use thiese settings:

Page ID 1
Page Type Category
Page Name OPML
Page Title GotzeLinkedOPML
Parent Page Root
Page Root 0
Breadcrumb Type Simple
Page Condition
Meta Description
Meta Keywords
Build Static Yes
Build Directory
Build Filename <%CategoryID%>.opml
Display Dynamic Yes
View Permissions Everybody
File Type HTML


It builds the files, but doesn't use the OPML-template for links, only headers.


I guess that I would prefer to be able to choose OPML, RSS, etc. as File Types. But any way to get it to build the files will make me happy.

John
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
How does your OPML.html template look like? Also, you might want to test the output and the available variables. So, insert <%GT::Template::dump%> on the bottom of the OPML.html template, and view the page through

page.cgi?page=OPML;category=1234

BTW, you probably should set 'build directory' to some directory. When you do a build, there will be many pages, and you don't want them to in your links home directory probably.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Building static files, xml, opml In reply to
Ah, loops Wink

Got it, thanks. Lots of static OPML-files are now up on http://slashdemocracy.org/links/ (in all categories)

John
Quote Reply
Re: [gotze] Building static files, xml, opml In reply to
OK, good.

Now that we have fixed this: what is OPML? What do you use it for?Blush

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
OPML In reply to
Thanks for asking Wink (maxpico too)

OPML is Outline Processor Markup Language. According to http://www.opml.org OPML is

Quote:


OPML [is] an XML-based format that allows exchange of outline-structured information between applications running on different operating systems and environments.


It's a format developed bu Userland.

As XML, it is problematic, as Mark Pilgrim said:

Quote:


So as far as I can tell, OPML is XML that isnít really XML, has (but doesnít use) a DTD that isnít really a DTD, and can only be properly defined as "whatever Userlandís tools happen to accept at the moment".


Nevertheless, it is used here and there, for example in blogrolls. That was what set me out on this journey ... I want to create my blogroll from Links SQL. Now I can Cool

John
Quote Reply
Re: [gotze] OPML In reply to
I have found a great and practical way to use OPML. Mix it with the Google SOAP api, and you can allow your users to search all the sites in your category with Google. Try my advanced search here, for a practical example:

http://slashdemocracy.org/links/Web_Services/

I use the code Micah Alpern offers (http://www.alpern.org/...gsearch/writeup.html). So can you. It's extremely easy to integrate with Links, in fact.

John
Quote Reply
Re: [gotze] OPML In reply to
John,

Could you describe how you used lSQL to setup a blog roll?

Thanks

Andre
CCUnet
my Christian web
Quote Reply
Re: [ccunet] OPML In reply to
Sure.

First of all, I run a category in LSQL with my favorite blogs. As mentioned above, I create an OPML-file from each category.

As for integrating the blogroll in my blog, I use the PHP-OPML-parser from http://www.defconzero.com/phpopml/view.php

I wrote up a bit on http://slashdemocracy.org/...archives/000702.html

John
Quote Reply
Re: [gotze] OPML In reply to
is it possiblr to build cat.html pages?
I tried <%CategoryID%>.html = 3.html, but I need cat_name.html