Mobileread
PrintableSub problem
#1  geoffreynz 08-23-2004, 07:56 AM
Can anyone help me with this site file? I can't seem to work out how to write the StoryToPrintableSub line. It's driving me crazy!

This is an example of an ordinary URL: http://www.lefigaro.fr/magazine/20040820.MAG0015.html
And here is its printable version:
http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0015

I get the following error message (but the URL it doesn't like works!)

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0014 to http://www.lefigaro.fr/magazine/20040820.MAG0014.html

The site file in question:

URL: http://www.lefigaro.fr/magazine/
Name: Le Figaro Magazine
Description: Le Figaro Magazine
Levels: 2
ContentsStart: <!--sdvD=tete-->
ContentsEnd: <!--sdvF=centred07-->
StoryURL: http://www.lefigaro.fr/magazine/\d+.MAG\d+\.html
StoryToPrintableSub: s,(http://www.lefigaro.fr)/(magazine)/(\d+.MAG\d+)\.html,$1/cgi/edition/genimprime?cle=$3,
StoryStart: <A CLASS=TIT-TETE
StoryEnd: <!-- VENTRE : F -->

Thanks in advance for any help - I'd greatly appreciate it.

Geoffrey

#2  Alexander Turcic 08-23-2004, 10:54 AM
Geoffrey,

try it with these pattern:

Code
StoryToPrintableSub: s{http://www.lefigaro.fr/magazine/(\d+.MAG\d+)\.html}{http://www.lefigaro.fr/cgi/edition/genimprime\?cle=$1}i StoryURL: http://www.lefigaro.fr/cgi/edition/genimprime\?cle=\d+.MAG\d+
I haven't tested it, but I don't see why it shouldn't work. I just had a look at your code; StoryURL must match the print URL, not the original URL!

Greets
Alex

#3  geoffreynz 08-23-2004, 05:30 PM
Thanks a lot for your help! Now it works with most of the URLs on the page, but it doesn't like the first ones on the page. See the error messages below:

Found 30 links, examining them.
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0014
SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0015 to http://www.lefigaro.fr/magazine/20040820.MAG0015.html

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0016 to http://www.lefigaro.fr/magazine/20040820.MAG0016.html

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0017 to http://www.lefigaro.fr/magazine/20040820.MAG0017.html

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0018 to http://www.lefigaro.fr/magazine/20040820.MAG0018.html

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0019 to http://www.lefigaro.fr/magazine/20040820.MAG0019.html

SITE WARNING: "lefigaromagazine.site" line 1: Printable version does not match S
toryURL pattern, reverting from http://www.lefigaro.fr/cgi/edition/genimprime?cl
e=20040820.MAG0020 to http://www.lefigaro.fr/magazine/20040820.MAG0020.html

Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0009
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0013
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0010
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0021
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0022
Reading: http://www.lefigaro.fr/cgi/edition/genimprime?cle=20040820.MAG0023

Thanks again for your help so far,

Geoffrey

#4  geoffreynz 08-23-2004, 09:23 PM
SOLVED!!! This site file is perfect. I'll probably upload a whole suite of .site files for Le Figaro next week. Thanks a lot to Alexander for all his help with this file!!!

URL: http://www.lefigaro.fr/magazine/
# Thanks to Alexander for all his help with making this site file!!!!
Name: Le Figaro Magazine
Description: Le Figaro Magazine
Levels: 2
ContentsStart: <!--sdvD=tete-->
ContentsEnd: <!--sdvF=centred07-->
StoryStart: <A CLASS=TIT-TETE
StoryEnd: <!-- VENTRE : F -->
StoryToPrintableSub:

s{http://www.lefigaro.fr/magazine/(\d+.MAG\d+.*)\.html}{http://www.lefigaro.fr/cgi/edition/genimprime\?cle=$1}i
StoryURL: http://www.lefigaro.fr/cgi/edition/genimprime\?cle=\d+.MAG\d+.*
ContentsUseTableSmarts: 0
# ImageURL version about 500k, no images about 80k
ImageURL: http://www.lefigaro.fr/photos/.*\.jpg.*

#5  Alexander Turcic 08-24-2004, 11:04 AM
Glad to hear Was definitely an interesting chat!

Today's Posts | Search this Thread | Login | Register