Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm maintaining a website for my wife (a singer) who regularly needs to update gig info. She knows enough about HTML to do simple updates to the text, but I'd like to automate the process.

I was thinking of making the gig listing page a CGI script which gets data from a spreadsheet using a module such as Spreadsheet::ParseExcel. There could be a column for each gig date, heading and details in the spreadsheet. The script could automatically sort by date and move older info into the 'past news' section.

My question: Has anyone tried this sort of thing? Do you think it is a good/silly/bad idea? Is there a better path to take, possibly not using Excel but sticking with the idea of my wife not needing to mess with the HTML? After all, (that's my domain! :) )

Thanks in advance for any advice you can offer me!

  • Comment on Generating websites from Excel Spreadsheets?

Replies are listed 'Best First'.
Re: Generating websites from Excel Spreadsheets?
by Cody Pendant (Prior) on Jul 23, 2003 at 02:44 UTC
    In the spirit of "90% of every Perl program is already written", why not just use one of the many blog applications out there like Movable Type or Bloxsom.

    Your wife's needs are similar to those of most bloggers -- easy editing of date-based information.

    If there's some need for Excel elswhere in the operation, it might be possible to export XML then import into the blog app -- some of them read XML I'm sure -- but unless you really need Excel you're just adding an extra level of complexity that you don't need.



    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print
Re: Generating websites from Excel Spreadsheets?
by nite_man (Deacon) on Jul 23, 2003 at 08:13 UTC

    You can use a following scenario for update gig section on site:

    • Prepare a new gig in Exel and save it as CSV.
    • Download this file on your site, parse (it needs just a simple script) and store data in the database or file.
    • Then this page can be generated dinamically using data from database or file.

          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);
    
Re: Generating websites from Excel Spreadsheets?
by WhiteBird (Hermit) on Jul 23, 2003 at 03:21 UTC
    Spreadsheets, in my experience, are not the best choice for organizing data. If you want to keep things organized in another program, why not use a database instead of a spreadsheet? It's easy enough to create an Access database to contain dates, places etc, and then tap into that with a CGI script using DBI. Even better is using MySQL instead of Access. (MySQL is freely available and easy to set up.)

    There's a wealth of information available here at perlmonks and on the web in general to help you get started if you aren't familiar with DBI and ODBC or databases in general. While a database might be overkill for your task right now, it might turn into something you could build on in the future.

Re: Generating websites from Excel Spreadsheets?
by chunlou (Curate) on Jul 23, 2003 at 05:49 UTC
    Since Excel can read and write CSV format seamlessly, if the data structure permits, use CSV with your CGI instead. Faster and easier.
Re: Generating websites from Excel Spreadsheets?
by Zero_Flop (Pilgrim) on Jul 23, 2003 at 06:31 UTC
    If your excel page will be local, then you can use excel's html export function to create the html.( if you go this route I would DL MS's update so that the export function generates civil HTML, and not that microsoft stuff) , or you can call a perl script from excel, on closing the file perl will parse it, and generate the html then post it to your site (check out VBA BeforeClose to call your perl.)
Re: Generating websites from Excel Spreadsheets?
by mildside (Friar) on Jul 23, 2003 at 01:50 UTC
    P.S. I'm not Anonymous really, I'm actually mildside. I didn't realise I wasn't logged in when I posted. Cheers!
      Since she has to input the data anyways why not just make an admin cgi form where she can add events? That way she can add/remove them from anywhere and you can use a template system to display the data in what ever format you wish. To me it seems more fluid to do all the update on the site and be able to add/remove dates as need be -- without having to reinport an excel ss every time a change is made.

      -Waswas
        True... I had thought about this, but it does add some complexity because of security issues. I'd have to think about a login/password scenario etc. I realise that there is probably stuff out there to handle that already, but as I'm relatively new to CGI, my way seemed like a safer and possibly simpler path. Plus the editing of the spreadsheet can be done off-line (we have dial-up :( )

        Thanks, it is all food for thought.

        P.S. You can see a current version of the page in question at http://www.emmasidney.com/upcoming.shtml

Re: Generating websites from Excel Spreadsheets?
by Willard B. Trophy (Hermit) on Jul 23, 2003 at 21:21 UTC
    Spreadsheet::ParseExcel is pretty solid, and if Excel is what works for data entry, it'll do a fine job of parsing the data. It's not the fastest routine in the world -- it's doing quite a lot -- so as I reckon a schedule would probably change less often that your site would get page views, caching the result based on file modification time would be good.

    I wonder if The Bay (a huge department store chain in Canada) is still using my Spreadsheet::ParseExcel code to generate all their product and price signage? It was pretty cool, but the output format (Quark Tags) wasn't.

    --
    bowling trophy thieves, die!

Re: Generating websites from Excel Spreadsheets?
by bobn (Chaplain) on Jul 23, 2003 at 03:16 UTC

    Why not just let her use an HTML editor? Teh compose function of Mozilla looks useable for this. Qantas also looks pretty good.

    --Bob Niederman, http://bob-n.com
Re: Generating websites from Excel Spreadsheets?
by mildside (Friar) on Jul 24, 2003 at 00:28 UTC
    Thanks everymonk for your very insightful replies! I now have a lot more knowledge about ways to go about my task.

    My current thinking: I'd still like to use Excel as my wife is very comfortable using it, but I'm thinking now that I'll run a script off-line that will process the spreadsheet data and produce my nicely formatted HTML page, then automaticaaly upload it to the web server. That way I don't need to worry about the overhead/delay involved in processing the spreedsheet on the fly (if I went the CGI route).