Wiki Home arrow MediaPortal Wiki

Customising WebEPG

What is WebEPG

WebEPG is another Electronic Program Guide grabbing application; however this one has been designed to be used with MediaPortal. There are a few other programs that do what WebEPG does but not as easily and not specifically designed to work with MediaPortal.

For general setup instructions, see the WebEPG setup guide.

HELP

For help on customising WebEPG see the following WIKI pages:

Site Config/Grabber File

To get EPG data from a website you need a Site Config or Grabber file. You must edit an existing grabber file or create a new grabber file.

The site config files are xml files located in the Mediaportal\WebEPG\Grabbers folder under the country code folder for your country.

If you create a new grabber file, use the domain url of the channel provider (e.g. www_hbo_com.xml). See the section below on Channel IDs for more detail.

The file structure for grabber files is here: Grabber file

Creating a new Grabber File

Here is an empty template you can use to get started:

<?xml version="1.0" encoding="utf-8"?>
<Grabber>
  <Info availableDays="" timezone="" version="2.0" />
  <Channels>
    <Channel id="" siteId="" />
  </Channels>
  <Listing type="Html">
    <Site url="" post="" external="false" encoding="" />
    <Html>
      <Template name="default" start="" end="">
        <SectionTemplate tags="">
          <TemplateText>
          </TemplateText>
        </SectionTemplate>
      </Template>
    </Html>
  </Listing>
</Grabber>

You need to enter the following data (always leave in the quotation marks!):

  • Info availableDays - the number of days data is available on the site
  • Channel id - the name of the channel configured in MediaPortal

  • site id - the name of the channel on the site (unless there is only one channel program listings)
  • site url - the url of the website containing program listings (this may contain optional parameters)
  • start - a unique text string to search for the START of the program listings on the website
  • end - a unique text string to search for the END of the program listings on the website
  • tags - The first letter of each HTML tag to be used for matching in the Template section.
    • Letters must be in upper case. Mutliple tags are given in a string "TSD"
  • Template Text - this is where you will enter the HTML tags and data fields that make up the program listing.

Entering the Template Text is usually the most difficult part. For this you need the HTML source for the page. This is easy in every browser normally by right-clicking on the page and "view-source". Then you need to locate the listings. Just search for the name of a program and the find the title, time, description, etc. Work out what is different between two programs and what is the same. You'll need to work out which HTML tags can be used to find the listings.

The best way to figure out the pattern of the website program listings is to use the WebEPG_Designer program.

For more details on the grabber file: Grabber file

For more details on entering Template text: WebEPG_Template

Testing

Once you have created your grabber file, open it into a web browser. This will check to see if the xml is correct. It will also give you any errors and the exact location of the errors in your grabber.xml file.

Once it passes the basic XML test, run WebEPG and see if any errors are reported. View the WebEGP.log and error.log files in the Mediaportal\Log folder.

NOTE: If your grabber file has errors it will not appear in the listings of channels or grabbers in the WebEPg Configuration!

Getting Data For More Than One Day

If you want to grab data for multiple days, and the data for subsequent days is on a different page, you need to figure out how to tell WebEPG to access those pages.

If the date is included in the URL, it is much easier. You can enter the variable Date data in the site url section of the grabber file (e.g. http://www.axn-india.com/schedule/[YYYY]/[MM]/[DD]/index.html')

You can find more details on different ways of entering the date information in Grabber file

If the date is NOT included in the URL, you may need to use the Post section of the grabber file. First you will need to find the Get/Post pattern. Look in the source data of the website for any method=post and find the name of the input. For example: post="schedule_date=[DD]/[MM]/[YYYY]" where "schedule_date" is the input id. See below for more details.

The GET/POST pattern

When the POST method is used, the page URL can be seen in the address/location bar of the web browser. However, when GET is used or the URL is not display a good way to get this information is to install a local proxy.

For example install Paros (http://sourceforge.net/projects/paros) and then configure your browser to use the proxy at 127.0.0.1. This will allow you to see all the requests made to the web site when surfing around.

Channel IDs

The channel IDs for WebEPG are stored in the channels.xml file. (Will be converted into a db in the future)

Rules for creating new IDs:

1. Use the domain url of the channel provider.

2. If the channel provider has an url in multiple countries (and these channels are not different), ie same content, then use the one from the country of origin or the international one (these channels may already be in use by other grabbers, so always use an existing ID when possible). If still no idea post here.

3. If the channel provider doesn't have a web site, then create a url like id with '-'s instead of '.'s.


<< Back to MediaPortal WebEPG

MediaPortal Wiki: MediaPortal_Setup_Customising_WebEPG (last edited 2008-10-05 21:46:48 by pbb)



by team-mediaportal.com - 2008 SourceForge.net Logo