Get
a web page:
[Page] [Error] = XGUI.Get([URL],[Grabber],[Username],[Password],[CacheFile],[MaxCacheAge])
Parameters:
- URL: String. Web page to retrieve
(including "http://")
- Grabber:
Userdata. Grabber
that is retrieving the page
- Username:
String. HTTP
request username (optional)
- Password:
String. HTTP
request password (optional)
- CacheFile:
String. File to
use for a cache of this page (optional)
- MaxCacheAge:
Number. Maximum
number of days to keep files in the cache (optional)
Return Values:
- Page: String. The retrieved web page
- Error:
Integer. The HTTP
response code
If the username and password are not specified then standard
anonymous HTTP is used.
If no cache file is specified then no caching is performed. If the
cache file doesn't exist then the page is downloaded and save to the
cache file.
The returned Error is 0 if the page was retrieved from the cache, -1 if a timeout occured and the retries failed,
otherwise it is the HTTP response code recieved from the server. For an
explanation of HTTP response codes and their meanings see here
Get
a setting:
[Value] = XGUI.GetSetting([Grabber],[Key],[Default])
Parameters:
- Grabber:
Userdata. Grabber
that is retrieving the setting
- Key: String. Name of the setting
to retrieve
- Default:
String. Default
value for the setting
Return Values:
- Value:
String. The
setting's value
This function retrieves a setting from "XMLTV_GUI.ini", settings are
stored under a section with the name of your grabber. Settings don't
have to be added using XGUI.AddSetting to be retrieved using this
function.
Add
a setting to the configuration
screen:
XGUI.AddSetting([Grabber],[Key],[Type],[Default],[Name])
Parameters:
- Grabber:
Userdata. Grabber
that is adding the setting
- Key: String. Name of the setting
to add
- Type: Integer. Type of the setting,
can have the folowing
values:
- XGUI.SettingType.Integer
- XGUI.SettingType.String
- XGUI.SettingType.Password
- XGUI.SettingType.Boolean
- Default: String. Default value for the setting
- Name: String. Lable to be displayed in the settings screen
This function should be called when the Init
function of your grabber is called.
Add a channel:
XGUI.AddChannel([Grabber],[Channel])
Parameters:
- Grabber:
Userdata. Grabber
to add the channel to
- Channel:
Channel.
Channel to add
This function should only be called when RefreshChannels
function of your grabber is called.
Get a channel:
[Channel] = XGUI.GetChannel([Grabber],[ID])
Parameters:
- Grabber:
Userdata. Grabber
to get the channel from
- ID: String.
ID of the channel to retrieve
Return Values:
Channel will be nil if the specified ID doesn't exist.
Clear all channels:
XGUI.ClearChannels([Grabber])
Parameters:
- Grabber:
Userdata. Grabber
to clear channels from
This function should only be called when RefreshChannels
function of your grabber is called, I recommend that if channels are
being downloaded from the internet then you download the appropriate
pages before clearing the channels.
Add a program:
XGUI.AddProgram([Grabber],[Program])
Parameters:
- Grabber:
Userdata. Grabber
to add the channel to
- Program:
Program.
Program to add
This function should only be called during a grabbing pass.