Before we begin note: You don't need to read all this if you only are interrested in getting EPG data in EyeTV. This is here for people interrested in how it does work.

EyeTV EPG Proxy is a server-based application. It runs on Apache with PHP (PHP SOAP module required).
The PHP scripts that makes the application will receive requests from EyeTV, and will return data that EyeTV can understand.

Before EyeTV can talk to your web server, you have to trick your Mac into thinking your web server is in fact the web server for data.titantv.com
This is easily done; simply add a line in your /etc/hosts file:
your.web.server.ip data.titantv.com

To make sure your new hosts file is used, instead of a possibly cached value, execute this in Terminal:
lookupd -flushcache


Details on how EyeTV EPG Proxy works

1. In EyeTV, when you enter your Zip Code, a request is sent to the web server. The request looks like this:

GET /dataservice.asmx/RegisterUserZip?
UUID=EGU7TZLA1JA94H679Z9WVV5ETEEG17&Zip=12345 HTTP/1.1
User-Agent: CFNetwork/129.16
Content-Type: text/xml; charset=utf-8
Connection: close
Host: data.titantv.com

Note: The UUID part of the request will always be ignored by the web server.

Note 2: The Zip Code you enter in EyeTV can be anything you'd like. It's not used for anything at this point.

2. The web server with reply with the available providers. The available providers are defined in config.inc.php. The data is sent in XML format using the http://www.titantv.com/services/dataservice namespace.

3. Once EyeTV received this information, you'll be presented with the available lineups in a drop down menu. When you choose one of them and click OK, EyeTV will send another request to the web server, asking for the channels of the lineup you chose. The request looks like this:

GET /dataservice.asmx/RequestLineupData?
UUID=EGU7TZLA1JA94H679Z9WVV5ETEEG17&ProviderId=A_00001 HTTP/1.1
User-Agent: CFNetwork/129.16
Content-Type: text/xml; charset=utf-8
Connection: close
Host: data.titantv.com

The ProviderId part of the request is the provider ID that you used in your config.inc.php file. EyeTV will remember this ID once you've chosen a provider, and always include it in requests for EPG data in the future.

4. Once again, the server will reply with XML data that EyeTV will interpret as channels. This data comes from either Zap2It Data Direct Web Service or XMLTV, depending on your configuration.

When Zap2It Data Direct is used as the EPG data source, the data taken from their web service is cached on your web server for 24h, to reduce the bandwidth used on your server. EyeTV can only fetch EPG data daily or weekly anyway.

Note: There's no advantage of using XMLTV in Canada. In XMLTV, EPG data for North America is taken from Zap2It. It's easier to simply configure a Canadian provider to use Zap2It directly.

5. When EyeTV wants to download EPG data, it will send the following request:

GET /dataservice.asmx/RequestProgramData?
UUID=EGU7TZLA1JA94H679Z9WVV5ETEEG17&ProviderId=A_00001&DaysRequested=8 HTTP/1.1
User-Agent: CFNetwork/129.16
Accept-Encoding: deflate
Connection: close
Host: data.titantv.com

One nice thing to note: The request specifies that "deflate" can be used to compress data that will be sent back for this request.

6. The web server will once again send XML data to answer this request. This will include all the channels lineup, all the programs definitions and their schedules. Uncompressed, all this data is about 3.5MB - 4MB.