View Single Post
pillar's Avatar
Posts: 154 | Thanked: 124 times | Joined on Mar 2007
#13
Okay, here is Dexter 0.2

Changes:

- It reads Text-TV sites from a config file
- Menu to switch between sites

I have tested it with two finnish text-tv's and it's working nice. Now it would be good to get some feedback whether you are able to get yours up too.

Config file:

Config file needs to be located at $HOME/.config/Dexter/dexter.conf

As of right now, you need to edit this by hand from the terminal.

Here is an example with two finnish Text-TV's:

Code:
[sites]
1\siteName=Mtv3
1\imageUrl=http://www.mtv3tekstikanava.fi/new2008/images/[page]-[subpage].gif
1\predictionUrl=http://www.mtv3tekstikanava.fi/new2008/[page]-01.htm
1\subPredictionUrl=http://www.mtv3tekstikanava.fi/new2008/[page]-[subpage].htm
1\previousPrediction="<a href=\"(\\d+)-01.htm\">&lt;&lt; Edellinen sivu</a>"
1\nextPrediction="<a href=\"(\\d+)-01.htm\">Seuraava sivu &gt;&gt;</a>"
1\previousSubPrediction="<a href=\"\\d+-(\\d+).htm\">&lt;&lt; alasivu</a>"
1\nextSubPrediction="<a href=\"\\d+-(\\d+).htm\">alasivu &gt;&gt;</a>"
1\pad=2
2\siteName=Yle
2\imageUrl=http://www.yle.fi/tekstitv/images/P[page]_[subpage].gif
2\predictionUrl=http://www.yle.fi/tekstitv/txt/P[page]_01.html
2\subPredictionUrl=http://www.yle.fi/tekstitv/txt/P[page]_[subpage].html
2\previousPrediction="<A HREF=\"http://www.yle.fi/tekstitv/txt/P(\\d+)_01.html\">\\[Edellinen sivu\\]</A>"
2\nextPrediction="<A HREF=\"http://www.yle.fi/tekstitv/txt/P(\\d+)_01.html\">\\[Seuraava sivu\\]</A>"
2\previousSubPrediction="<A HREF=\"http://www.yle.fi/tekstitv/txt/P(\\d+)_(\\d+).html\">\\[Edellinen alasivu\\]</A>"
2\nextSubPrediction="<A HREF=\"http://www.yle.fi/tekstitv/txt/P(\\d+)_(\\d+).html\">\\[Seuraava alasivu\\]</A>"
2\pad=2
size=2
You can try adding your own, just increase the size in the end and copy paste one entry. Then edit the url's/regular expressions. When url has page number, replace it with [page] and subpage replace with [subpage]. Then the code will replace the correct values at runtime.

imageUrl: Where the actual image of the page is located at.
predictionUrl: A html page where the previous/next page number can be found and parsed
subPredictionUrl: Similar, but for parsing subpage prediction
previousPrediction: Regular expression to find the previous page number. Find this from the source code and replace page number with (\\d+).
nextPrediction: Similar, but for next page.
previousSubPrediction: Similar, but for previous subpage.
nextSubPrediction: Similar, but for next subpage.
pad: How many digits are used in the subpage.This varies between the sites, so it was important to be able to change this. For example, finnish sites then to use padding 2, which would make subpage 1 to be 01.

This is just a quick version for the ones that want to help and figure out how it works. Please know your stuff before trying this right now.

Last edited by pillar; 2010-02-02 at 09:09.