1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright 2002-2004 The Apache Software Foundation or its licensors,
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
18 <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
21 <title>Automatic Recording for KiSS Hard Disk Recorders</title>
25 KiSS makes regular updates to their site that sometimes require adaptations
26 to the crawler. If it stops working, check out the most recent version here.
28 <section id="changelog">
29 <title>Changelog</title>
32 <title>7 September 2006</title>
34 <li>KiSS modified the login procedure. It is now working again.</li>
35 <li>Generalized the startup scripts. They should now be insensitive to the specific libraries used. </li>
39 <title>31 August 2006</title>
41 <li>Added windows bat file for running the crawler under windows.
42 Very add-hoc, will be generalized. </li>
46 <title>17 November 2006</title>
48 <li>Corrected the packed distributions. The standalone distribution
49 had an error in the scripts and was missing libraries </li>
52 <title>24 August 2006</title>
54 <li>The crawler now uses desktop login for crawling. Also, it is much more efficient since
55 it no longer needs to crawl the individual programs. This is because the channel page
56 includes descriptions of programs in javascript popups which can be used by the crawler.
57 The result is a significant reduction of the load on the KiSS EPG site. Also, the delay
58 between requests has been increased to further reduce load on the KiSS EPG site. </li>
60 The crawler now crawls programs for tomorrow instead of for today.
63 The web based crawler is configured to run only between 7pm and 12pm. It used to run at
70 <title>13-20 August 2006</title>
72 There were several changes to the login procedure, requiring modifications to the crawler.
75 <li>The crawler now uses the 'Referer' header field correctly at login.</li>
76 <li>KiSS now uses hidden form fields in their login process which are now also handled correctly by the
81 <section id="overview">
82 <title>Overview</title>
85 In 2005, <a href="site:links/kiss">KiSS</a> introduced the ability
86 to schedule recordings on KiSS hard disk recorder (such as the
87 DP-558) through a web site on the internet. When a new recording is
88 scheduled through the web site, the KiSS recorder finds out about
89 this new recording by polling a server on the internet.
90 This is a really cool feature since it basically allows programming
91 the recorder when away from home.
94 After using this feature for some time now, I started noticing regular
95 patterns. Often you are looking for the same programs and for certain
96 types of programs. So, wouldn't it be nice to have a program
97 do this work for you and automatically record programs and notify you
98 of possibly interesting ones?
101 This is where the KiSS crawler comes in. This is a simple crawler which
102 logs on to the KiSS electronic programme guide web site and gets
103 programme information from there. Then based on that it automatically
104 records programs for you or sends notifications about interesting ones.
107 In its current version, the crawler can be used in two ways:
110 <li><strong>standalone program</strong>: A standalone program run as a scheduled task.</li>
111 <li><strong>web application</strong>: A web application running on a java
112 application server. With this type of use, the crawler also features an automatic retry
113 mechanism in case of failures, as well as a simple web interface. </li>
118 <title>Downloading</title>
121 At this moment, no formal releases have been made and only the latest
122 version can be downloaded.
125 The easy way to start is the
126 <a href="installs/crawler/target/wamblee-crawler-0.2-SNAPSHOT-kissbin.zip">standalone program binary version</a>
127 or using the <a href="installs/crawler/kissweb/target/wamblee-crawler-kissweb.war">web
131 The latest source can be obtained from subversion with the
132 URL <code>https://wamblee.org/svn/public/utils</code>. The subversion
133 repository allows read-only access to anyone.
136 The application was developed and tested on SuSE linux 9.1 with JBoss 4.0.2 application
137 server (only required for the web application). It requires at least a Java Virtual Machine
138 1.5 or greater to run.
143 <title>Configuring the crawler</title>
146 The crawler comes with three configuration files:
149 <li><code>crawler.xml</code>: basic crawler configuration
150 tailored to the KiSS electronic programme guide.</li>
151 <li><code>programs.xml</code>: containing a description of which
152 programs must be recorded and which programs are interesting.</li>
153 <li><code>org.wamblee.crawler.properties</code>: Containing a configuration </li>
156 For the standalone program, all configuration files are in the <code>conf</code> directory.
157 For the web application, the properties files is located in the <code>WEB-INF/classes</code>
158 directory of the web application, and <code>crawler.xml</code> and <code>programs.xml</code>
159 are located outside of the web application at a location configured in the properties file.
164 <title>Crawler configuration <code>crawler.xml</code></title>
167 First of all, copy the <code>config.xml.example</code> file
168 to <code>config.xml</code>. After that, edit the first entry of
169 that file and replace <code>user</code> and <code>passwd</code>
170 with your personal user id and password for the KiSS Electronic
176 <title>Program configuration</title>
178 Interesting TV shows are described using <code>program</code>
179 elements. Each <code>program</code> element contains
180 one or more <code>match</code> elements that describe
181 a condition that the interesting program must match.
184 Matching can be done on the following properties of a program:
187 <tr><th>Field name</th>
188 <th>Description</th></tr>
191 <td>Program name</td>
195 <td>Program description</td>
199 <td>Channel name</td>
203 <td>Keywords/classification of the program.</td>
207 The field to match is specified using the <code>field</code>
208 attribute of the <code>match</code> element. If no field name
209 is specified then the program name is matched. Matching is done
210 by converting the field value to lowercase and then doing a
211 perl-like regular expression match of the provided value. As a
212 result, the content of the match element should be specified in
213 lower case otherwise the pattern will never match.
214 If multiple <code>match</code> elements are specified for a
215 given <code>program</code> element, then all matches must
216 apply for a program to be interesting.
224 <th>Example of matching field values</th>
227 <td>the.*x.*files</td>
228 <td>"The X files", "The X-Files: the making of"</td>
232 <td>"Star Trek Voyager", "Star Trek: The next generation"</td>
237 It is possible that different programs cannot be recorded
238 since they overlap. To deal with such conflicts, it is possible
239 to specify a priority using the <code>priority</code> element.
240 Higher values of the priority value mean a higher priority.
241 If two programs have the same priority, then it is (more or less)
242 unspecified which of the two will be recorded, but it will at least
243 record one program. If no priority is specified, then the
248 Since it is not always desirable to try to record every
249 program that matches the criteria, it is also possible to
250 generate notifications for interesting programs only without
251 recording them. This is done by specifying the
252 <code>action</code> alement with the content <code>notify</code>.
253 By default, the <code>action</code> is <code>record</code>.
254 To make the mail reports more readable it is possible to
255 also assign a category to a program for grouping interesting
256 programs. This can be done using the <code>category</code>
257 element. Note that if the <code>action</code> is
258 <code>notify</code>. then the <code>priority</code> element
265 <title>Notification configuration</title>
267 Edit the configuration file <code>org.wamblee.crawler.properties</code>.
268 The properties file is self-explanatory.
277 <title>Installing and running the crawler</title>
280 <title>Standalone application</title>
282 In the binary distribution, execute the
283 <code>run</code> script for your operating system
284 (<code>run.bat</code> for windows, and
285 <code>run.sh</code> for unix).
290 <title>Web application</title>
292 After deploying the web application, navigate to the
293 application in your browser (e.g.
294 <code>http://localhost:8080/wamblee-crawler-kissweb</code>).
295 The screen should show an overview of the last time it ran (if
296 it ran before) as well as a button to run the crawler immediately.
297 Also, the result of the last run can be viewed.
298 The crawler will run automatically every morning at 5 AM local time,
299 and will retry at 1 hour intervals in case of failure to retrieve
300 programme information.
305 <title>Source distribution</title>
307 With the source code, build everything with
308 <code>ant dist-lite</code>, then locate the binary
309 distribution in <code>lib/wamblee/crawler/kiss/kiss-crawler-bin.zip</code>.
310 Then proceed as for the binary distribution.
315 <title>General usage</title>
317 When the crawler runs, it
318 retrieves the programs for tomorrow. As a result, it is advisable
319 to run the program at an early point of the day as a scheduled
320 task (e.g. cron on unix). For the web application this is
321 preconfigured at 5AM.
324 If you deploy the web application today, it will run automatically
325 on the next (!) day. This even holds if you deploy the application
326 before the normal scheduled time.
330 Modifying the program to allow it to investigate tomorrow's
331 programs instead is easy as well but not yet implemented.
338 <section id="examples">
339 <title>Examples</title>
342 The best example is in the distribution itself. It is my personal
343 <code>programs.xml</code> file.
348 <title>Contributing</title>
351 You are always welcome to contribute. If you find a problem just
352 tell me about it and if you have ideas am I always interested to
356 If you are a programmer and have a fix for a bug, just send me a
357 patch and if you are fanatic enough and have ideas, I can also
358 give you write access to the repository.