7 - Read the Docs
Transcription
7 - Read the Docs
Moduleπ π Version latest-0.1.0-23-g5ccfd2f 07 February 2017 Table des matières 1 Prerequisites 3 2 Configuration 2.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 5 3 Usage 3.1 Provided commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 7 i ii Moduleπ π, π πππ ππππππ‘ππ π‘ β 0.1.0 β 23 β π5πππ π2π Erebot_Module_TV is a module for Erebot that fetches TV timetables from Internet. Contents : Table des matières 1 Moduleπ π, π πππ ππππππ‘ππ π‘ β 0.1.0 β 23 β π5πππ π2π 2 Table des matières CHAPITRE 1 Prerequisites The following dependencies must be installed in order for this module to work properly : β PHP >= 5.2.2 β Erebot (some specific version may be required depending on this moduleβs version) β Erebot_API (some specific version may be required depending on this moduleβs version) β HTTP_Request2 (which in turn requires Net_URL2) β The pecl.php.net/intl extension. Erebot (core) adds its own set of prerequisites which usually superseed those. 3 Moduleπ π, π πππ ππππππ‘ππ π‘ β 0.1.0 β 23 β π5πππ π2π 4 Chapitre 1. Prerequisites CHAPITRE 2 Configuration 2.1 Options This module provides several configuration options. Tableau 2.1 β Options for Module_TV Name Type Default value Description fetstringβEreThe class to use to retrieve TV schedules. The default is fine unless you have cher_class bot_Module_TV_Fetcherβ specific needs for something else. This class should implement the Erebot_Module_TV_Fetcher_Interface interface. group_name stringn/a A list of comma-separated TV channel names, that form a common group. The βnameβ part of the parameter is used as the name of the group. This option may be used several times (with varying βnameβ parts) to create additional groups. This parameter is optional. destringn/a If no TV channel has been given to the bot when requesting TV schedules, it fault_group will retrieve schedules for channels in this group instead. This parameter is optional. trigger stringβtvβ The command to use to display TV schedules. Avertissement : The trigger should only contain alphanumeric characters (in particular, do not add any prefix, like β !β to that value). 2.2 Example In this example, we use a custom fetching class called My_TV_Fetcher and we define a group called βhertzienβ which will contain the 7 basic french TV channels available using classical terrestrial TV technology. This will also be the default group if the bot is queried for TV schedules without any additional parameter. <?xml version=''1.0''?> <configuration xmlns=''http://localhost/Erebot/'' version=''0.20'' language=''fr-FR'' timezone=''Europe/Paris''> <modules> <!-- Other modules ignored for clarity. --> 5 Moduleπ π, π πππ ππππππ‘ππ π‘ β 0.1.0 β 23 β π5πππ π2π <module name=''Module_TV``> <!-- Override the default fetcher. --> <param name=''fetcher_class'' value=''My_TV_Fetcher'' /> <!-- Create a group called ``hertzien''. --> <param name=''group_hertzien'' value=''TF1,France2,France3,Canal+,France5,M6,Arte'' <!-- And use it as the default group. --> <param name=''default_group'' value=''hertzien'' /> </module> </modules> </configuration> 6 Chapitre 2. Configuration CHAPITRE 3 Usage This section assumes default values are used for all triggers. Please refer to configuration options for more information on how to customize triggers. 3.1 Provided commands This module provides the following commands : Tableau 3.1 β Commands provided by Module_TV Command !tv !tv time !tv time channels... Description Displays information about currently airing TV programs for the default channels group. Displays information about TV programs for the default channels group at the given time. time may be given in either 12h or 24h format. Displays TV schedules for the given channels at the given time. You may also use a channel group in place of channels. time may be given in either 12h or 24h format. Note : A list of valid channel groups can be retrieved using !help tv. 3.2 Example 20:58:13 <@Clicky> !tv 20:58:20 < Erebot> Programmes TV du January 17, 2012 8:58:00 PM : TF1 : Les experts : Manhattan (20:5 22:35) - France 3 : Famille d'accueil (20:35 - 21:30) - Canal+ : Another Year (20: (20:35 - 21:45) - Arte : L'effet domino (20:40 - 22:15) - M6 : Cauchemar en cuisin 20:58:29 <@Clicky> !tv 22h 20:58:33 < Erebot> Programmes TV du January 17, 2012 10:00:00 PM : TF1 : Les experts : Manhattan (21: 22:35) - France 3 : Famille d'accueil (21:30 - 22:25) - Canal+ : Another Year (20: 22:15) - Arte : L'effet domino (20:40 - 22:15) - M6 : Cauchemar en cuisine (20:50 21:28:56 <@Clicky> !tv 23h TF1 21:29:02 < Erebot> Programmes TV du January 17, 2012 11:00:00 PM : TF1 : Les experts : Manhattan (22: Current status on http://travis-ci.org/ : 7