Re: Automated Production of Web Pages

2009-06-18 Thread Wojciech Puchar

I have been asked to come up with an automated way of producing
web pages. Specifically, this is for mrtg but it really doesn't
matter. The idea is that there are many pages which are
identical except for different names and a couple of other items
such as whether the page represents a system that is actively
being polled or was being polled at one time but is now here for
archival purposes, that sort of thing.


sed is great for your needs.

If not enough - simply write bash script. HTML is purely text format, so 
generating it with unix tools is simple.



Is there any open-source platform which makes this
especially quick and easy? Of course, as one who likes to script


Yes. all standard unix tools. bash, sed, perl, awk, 100th of others.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Automated Production of Web Pages

2009-06-18 Thread Bill Moran
In response to Martin McCormick mar...@dc.cis.okstate.edu:

 I have been asked to come up with an automated way of producing
 web pages. Specifically, this is for mrtg but it really doesn't
 matter. The idea is that there are many pages which are
 identical except for different names and a couple of other items
 such as whether the page represents a system that is actively
 being polled or was being polled at one time but is now here for
 archival purposes, that sort of thing.
 
   This needs to be some sort of script application so we
 can feed it automatically and not have to manually build each
 page.
 
   Is there any open-source platform which makes this
 especially quick and easy? Of course, as one who likes to script
 repetitive tasks, I can attest to the fact that that first
 script is murder at times but the time you spent building it is
 payed back the next time when it runs automatically at 3 A.M.
 and only took 15 seconds to run. That's why I love Unix.
 
   So, are there php-based or other packages that help
 automate this process?

routers2 may fit your need:
http://www.steveshipway.org/software/

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Automated Production of Web Pages

2009-06-18 Thread Polytropon
On Thu, 18 Jun 2009 06:55:41 -0500, Martin McCormick 
mar...@dc.cis.okstate.edu wrote:
   This needs to be some sort of script application so we
 can feed it automatically and not have to manually build each
 page.
 
   Is there any open-source platform which makes this
 especially quick and easy?

I've found that a source file from : separated valus serves
well for the (sometimes changed and appended) source data,
and a Makefile that does everything else. From this Makefile,
I simply first call a preamble HTML file, then a simple
awk script that adds the data lines, sourced by the CSV
file, in HTML format, and finally a HTML file with the
rest of the page. The command make install would then
automatically upload it.



 Of course, as one who likes to script
 repetitive tasks, I can attest to the fact that that first
 script is murder at times but the time you spent building it is
 payed back the next time when it runs automatically at 3 A.M.
 and only took 15 seconds to run.

Really, it's not a big deal, no murder at times. The easiest
way is you start with one HTML file that represents what you
want to have in the end, then cut it into three parts (the
preamble, the changing part, the footer) and the replace the
changing part by a script.

Well, you can even (ab)use cpp for this.

HTMLPP=cpp -C -P -traditional

The advantage is that you have separated parts for everything.
The preamble file changes the look of the page, e. g. via CSS.
The CSV database contains the changing data, and the awk script
contains the description how the data should be displayed. This
separation makes it very easy if you want to change of of the
different aspects I mentioned.



   So, are there php-based or other packages that help
 automate this process?

Forgive my polite disagreement, but according to your description
which sounds to describe a relatively easy problem, PHP looks
like really too much, too big for this job. (I don't use PHP
very often, so my opinion might not be the best one to rely on.)



 That's why I love Unix.

If you love UNIX, why not following its philosophy? Keep the
thing simple. Make one solution that solves the problem best,
nothing more, nothing less. As you said, it may take some time
to get it running, but when it runs, it will run nearly forever.




-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Automated Production of Web Pages

2009-06-18 Thread Wojciech Puchar

HTMLPP=cpp -C -P -traditional


actually it's the way i make webpages.


automate this process?


Forgive my polite disagreement, but according to your description
which sounds to describe a relatively easy problem, PHP looks
like really too much, too big for this job. (I don't use PHP
very often, so my opinion might not be the best one to rely on.)


PHP is popular, and like most popular things isn't very good. Maybe it's 
easy for some people (for me - not much), and fits someone's needs, it 
could be used but as PREPROCESSOR.


There is no sense to generate webpage every time someone watch it, unless 
it's contents changes every time someone watch it.


PHP interpreter can be called from command line, and output HTML to file 
like that


php -f file.php file.html

This can be done from cron for example. It's not more efficient way, but 
more secure - there is no fear someone abuse any bugs in PHP code. PHP 
support in web server can be not loaded at all.




That's why I love Unix.


If you love UNIX, why not following its philosophy? Keep the
thing simple. Make one solution that solves the problem best,
nothing more, nothing less. As you said, it may take some time
to get it running, but when it runs, it will run nearly forever.


I have my things going exactly that way - because - as you say - i keep
things simple.

No modern tools with it's unneeded overcomplexity.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org