[vox] How are lugod-local.ics and lugod-only.ics generated?

Bill Kendrick nbs at sonic.net
Sun Jan 3 12:56:22 PST 2016


On Sat, Jan 02, 2016 at 06:56:00PM -0800, Rick Moen wrote:
> I've long been one of the biggest fans of LUGOD's
> http://www.lugod.org/calendar/ , especially because, since 1997, I've
> maintained the calendar Bay Area Linux Events, and LUGOD's is prettier.
> Moreover, and I say this with heartfelt appreciation as someone who
> knows how much trouble is involved, the events/groups contents are
> always _really_ well maintained.
> 
> The webcal://www.lugod.org/calendar/lugod-local.ics and
>     webcal://www.lugod.org/calendar/lugod-only.ics
> feature is distinctively nice.  _So_:
> 
> 1.  Is it generated from the same back-end database that (I assume)
> drives the Web calendar?

If by "database", you mean a .php file that is include()-ed and
runs one function call for each event, then yet. ;)

e.g.:

-----
...
  fpe("lugod", "0", "20160105-1900", "-2100",
  "/meeting/",
  $LUGOD_SOCIAL);

  fpe("svlug", "3", "20160106-1900", "-2100",
  "http://www.svlug.org/",
  $SVLUG . "\"Bitcoin: Digital Cash -- The Basics\"");

  fpe("none", "0", "20160109-1600", "-2359",
  "http://linuxmafia.com/cabal/",
  $CABAL);
...
----

(fpe = front page event ;) )


> 2.  What software generates the iCalendar files?  Is it available?
> Is it open source?

It's a combination of simple ICS template as a PHP script,
and a Makefile.  Nothing to write home about, I'm sad to say.

In the end, my workflow is:

 (1) add some events to the `events.php` file, which is include()-ed
     by the home page, as well as the /calendar page, and therefore
     changes appear instantly

 (2) 'cd calendar' and 'make', to generate fresh versions of the .ics
     files, based on `events.php`


> 3.  Same questions for the site's RSS+XML News Feed.

Similar story. :)  Except the news itself is a plaintext file of
a particular format -- line with a date/time-stamp, line with
a headline, multiple lines of HTML, then a blank line; rinse, repeat.

e.g.:

----
2015-12-27 11:55
LUGOD special elections again
Kenneth Lyons nominated himself for the 'typescript' (secretary)
officer position at LUGOD, after Andrew Roach decided to step down
at the end of his term, back in October.  His nomination was accepted
with no objections at our December meeting last week.  Thanks and
congratulations.

2015-11-29 17:00
Flyer for Amateur (ham) Radio roundtable in December
Help promote our <a href="/meeting/upcoming/">next meeting</a> by
printing and posting <a href="/documents/flyers/">a flyer for
December's Amateur (ham) Radio roundtable</a>! Thanks in advance!

...
----

That file is read (fopen(), fgets()) and parsed by PHP on the
homepage, and also the /news page.  There's another PHP script
which reads it and spits out the RSS feed XML.

A Makefile is used to convert `news.txt` to `rss.xml`, via this
silliness :)

----
rss.xml:        news.txt news.php news_as_xml.php
        wget -O rss.xml http://www.lugod.org/news/news_as_xml.php
----


> Thank you.  Please?
> 
> 
> One of these days, I'd like to make BALE auto-output iCalendar files.
> I've come pretty close just hacking dumped data using awk and sed, but
> it'd be nice to not reinvent wheels if it's a solved problem.
> 
> FWIW, a complete set of BALE's software & conffiles is available (GPLv2+):
> http://linuxmafia.com/pub/linux/network/autobale-1.0.tar.gz
> Requirements:  /usr/bin/php5, any Web server (need not do PHP),
> autoconf, cron, Python.

All my junk is documented, though source isn't available (since it's
pretty specialized to LUGOD, and not really worth using more
generically), over here, FYI:

  http://lugod.org/documents/howtos/lugod-website-howto.txt


-- 
-bill!
Sent from my computer


More information about the vox mailing list