              Automatic Zapit Satellite (AZS)
              -------------------------------

LICENSE
=======================================================================
This software is covered by the terms of the GNU General Public License
Version 2. The full license text can be found in the file COPYING.


ABOUT
=======================================================================
This collection of XSL stylesheets and bash scripts perform an
automatic retrieval of the Astra 19.2E channel list from Lyngsat
(http:www.lyngsat.com/astra19.html) and converts it into the
services.xml file.

An additional stylesheet converts the services.xml into the file
bouquets.xml. For that to be done automatically the user needs
to provide a mybouquets.xml file with bouquets where he does the
assignment between the channel name and a bouquet. The stylesheet
then takes care of creating the valid bouquets.xml from the
user-defined mapping file and the services.xml file.

The idea of writing a bunch of scripts came up because I was getting
tired of using GUI tools to keep the services.xml up to date. The
tools I was using were very buggy and not really easy to use from a
usability point of view. That was when I started
looking into an automatic solution which can be used to update the
services.xml each time the lyngsat page gets updated.


REQUIREMENTS
=======================================================================
The following software is necessary to run the script

   o xsltproc
      - libxml (20617)
      - libxslt (10112)
      - libexslt (810)
   o tidy (01. August 2004)
   o wget (1.9.1)
   o expect (5.42.1)


HOW IT WORKS
=======================================================================
The services.sh script performs the following steps:

1. Get the Astra19 HTML page from Lyngsat with wget

2. Convert the HTML page to well-formed xml with tidy

3. Cleanup the HTML page and remove unnecessary tags
   like a, span, b, div, i, u, font

4. Remove &nbsp; character entities from the XHTML file

5. Tidy the HTML page again to remove unnecessary blanks
   and get an easy readable structure

6. Convert the DVB entries into the services.xml structure

7. Write the services.xml


The bouquets.sh script performs the following steps:

1. Convert the services.xml into the bouquets.xml structure

2. Write the bouquets.xml file

The files2dbox.ex script performs the following steps:

1. Upload the files services.xml and bouquets.xml to the box

2. Invoke pzapit -c on the box to reload the files


The script azs.sh just combines the three scripts from above.


HOWTO
=======================================================================
1. Edit the file mybouquets.xml and adapt the mapping to your needs.
   This only needs to be done once. There might be fixes necessary when
   for example channel names have changed.
2. Run the script ./update-channels.sh


FAQ
=======================================================================
1. Q: Why is the services.xml file empty?
   A: Look at the end of the log file lyngsat.log. Most probably the
      last lines contains some error message that might point you
      to the problem. 

2. Q: The scripts completes very fast without doing anything,
      what is wrong?
   A: This happens for example when you are behind a proxy and wget
      is not able to connect to www.lyngsat.com. Specify a proxy
      by exporting the variable:

         export http_proxy=http://yourproxy:yourproxyport

      And then rerun the script.


KNOWN BUGS
=======================================================================
This script has been tested under Linux, especially Debian Woody, Sarge
and Ubuntu 5.04. So far no bugs are known but if you find any
problem then please send an email to michael@rumpfonline.de.

