Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Other formats > LRF

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2007, 02:27 AM   #76
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
Quote:
Originally Posted by kovidgoyal View Post
The problem with wired is that the files are encoded in UTF8 but they specify the encoding as iso8859-1. You can try either
1) Contact wired
2) write a preprocess regexp that changes the specified encoding
Code:
(r'<meta http-equiv="Content-Type" content="text/html; charset=(\S+)"',
 lambda match : match.group().replace(match.group(1), 'UTF-8'))
I see, I tried changing the wired.py to specify a iso8859-1 encoding, but this didn't fix the problem, the apostrophes are still funny...will keep hacking at it. Also tried searching for the exact hex sequence that is causing trouble and replacing it with a normal apostrophe without success:

(r'\xE2\x80\x99', lambda match: "'"),



Any ideas?

Dave

Last edited by DaveNB; 11-28-2007 at 03:25 AM.
DaveNB is offline   Reply With Quote
Old 11-28-2007, 02:49 AM   #77
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm not sure that regexp is correct, use --keep-downloaded-files to make sure, it's actually being applied.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-28-2007, 03:54 AM   #78
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
Yeah, I wasn't so sure about that regex either, but your previous suggestion of correcting Wired.com's claimed encoding to UTF-8 worked perfectly, didn't even have to search for the errant pattern and correct it. Hopefully this will fix all accented characters as well (they were showing up funny after the LRF conversion).

Version 0.7 now being put up on Kovid's Wiki for custom user profiles for web2lrf. It's alot easier to post the changes in just one place that way.
https://libprs500.kovidgoyal.net/wiki/UserProfiles
Apostrophe's fixed.

Dave
DaveNB is offline   Reply With Quote
Old 11-28-2007, 05:38 AM   #79
FixB
Groupie
FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.
 
FixB's Avatar
 
Posts: 186
Karma: 499
Join Date: Oct 2007
Location: France, Toulouse
Device: Sony PRS500
Quote:
Originally Posted by kovidgoyal View Post
I'm not sure that regexp is correct, use --keep-downloaded-files to make sure, it's actually being applied.
That's the command line option I was looking for !!! Thanks !!
FixB is offline   Reply With Quote
Old 11-30-2007, 07:03 AM   #80
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
I wrote up a HOWTO and posted it to Kovid's libprs500 page
OK, I put up a quick and dirty and hopefully helpful HOWTO here:
https://libprs500.kovidgoyal.net/wiki/UserProfiles

Hope that helps.

Dave
DaveNB is offline   Reply With Quote
Advert
Old 11-30-2007, 11:29 AM   #81
StDo
Translating Calibre...
StDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with others
 
StDo's Avatar
 
Posts: 657
Karma: 2902
Join Date: Aug 2007
Location: ER.de
Device: [PRS-500], PB360
Quote:
Originally Posted by DaveNB View Post
I wrote up a HOWTO and posted it to Kovid's libprs500 page
OK, I put up a quick and dirty and hopefully helpful HOWTO here:
https://libprs500.kovidgoyal.net/wiki/UserProfiles

Hope that helps.

Dave
Great! Thanks.

Maybe Kovid can create a link to a new page with your HOWTO.

The User Profile page is getting too big...
StDo is offline   Reply With Quote
Old 11-30-2007, 11:47 AM   #82
JTravers
Groupie
JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.JTravers ought to be getting tired of karma fortunes by now.
 
Posts: 182
Karma: 1078201
Join Date: Sep 2007
Device: iPad Air 2
Quote:
Originally Posted by DaveNB View Post
I wrote up a HOWTO and posted it to Kovid's libprs500 page
OK, I put up a quick and dirty and hopefully helpful HOWTO here:
https://libprs500.kovidgoyal.net/wiki/UserProfiles

Hope that helps.

Dave
Great stuff. This is so very helpful.

One question I wanted to ask Kovid, you, or anyone else with more experience building profiles. Is it possible to setup a profile in order to clean up a regular web page that links to the content you want? Or are the profiles strictly for use with RSS feeds?

Thanks!
JTravers is offline   Reply With Quote
Old 11-30-2007, 01:08 PM   #83
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@DaveNB
Thanks, I've moved your HOWTO to a separate page that is referenced from UserProfiles https://libprs500.kovidgoyal.net/wiki/UserProfilesHOWTO
That way you can address it directly and the UserProfiles page doesn't become too long.

@JTravers
The behavior of web2lrf is fully customizable.
You would need to re-define the build_index function in your profile to simply return the path to the pre-built index file.
kovidgoyal is offline   Reply With Quote
Old 11-30-2007, 11:35 PM   #84
veshman
Member
veshman began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2007
Device: Sony 505
Hey guys, I just wanted to say congrats on getting Wired done!....even though I haven't had a chance to tinker with it all week, I am keeping up with the progress.

I'll try to use the HOWTO dave posted to work on The Atlantic, www.theatlantic.com, one of my favorite reads. I was having some trouble picking out the links last time I tried, I think, but I'll give it another go.

bhavesh
veshman is offline   Reply With Quote
Old 12-01-2007, 06:52 PM   #85
StDo
Translating Calibre...
StDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with others
 
StDo's Avatar
 
Posts: 657
Karma: 2902
Join Date: Aug 2007
Location: ER.de
Device: [PRS-500], PB360
Can anybody give me a hint how to insert "druck-" after the penultimate comma of the following link?

http://www.spiegel.de/sport/sonst/0,1518,520867,00.html

It should look like this afterwards:
http://www.spiegel.de/sport/sonst/0,...520867,00.html

So where are the phyton specialists?
StDo is offline   Reply With Quote
Old 12-01-2007, 07:15 PM   #86
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
tokens = url.split(',')
tokens[-2:-1] = ['-druck']
url = ','.join(tokens)

that's just off the top of my head you'll almost certainly have to modify it to make it work correctly.
kovidgoyal is offline   Reply With Quote
Old 12-02-2007, 06:23 AM   #87
StDo
Translating Calibre...
StDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with others
 
StDo's Avatar
 
Posts: 657
Karma: 2902
Join Date: Aug 2007
Location: ER.de
Device: [PRS-500], PB360
Quote:
Originally Posted by kovidgoyal View Post
tokens = url.split(',')
tokens[-2:-1] = ['-druck']
url = ','.join(tokens)
Where do I have to implement that?

Somewhere after:
Code:
    def get_feeds(self): 
        return [ ('Spiegel Online', 'http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml') ] 
    
    def print_version(self,url):
        return url.replace
Tried different versions, however I am getting an error:
Quote:
SyntaxError: invalid syntax
StDo is offline   Reply With Quote
Old 12-02-2007, 01:20 PM   #88
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
def print_version(self,url):
    tokens = url.split(',') 
    tokens[-2:-1] = ['-druck']
    return ','.join(tokens)
kovidgoyal is offline   Reply With Quote
Old 12-02-2007, 02:24 PM   #89
StDo
Translating Calibre...
StDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with othersStDo plays well with others
 
StDo's Avatar
 
Posts: 657
Karma: 2902
Join Date: Aug 2007
Location: ER.de
Device: [PRS-500], PB360
Hmm.

Quote:
tokens[-2:-1] = ['-druck']
-this-is--a-spaceholder--^
IndentationError: unindent does not match any outer indentation level
He does not like the "]"

StDo is offline   Reply With Quote
Old 12-02-2007, 02:31 PM   #90
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just retype the function making sure that the indentation is all spaces and equal
kovidgoyal is offline   Reply With Quote
Reply

Tags
libprs500, web2lrf

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
web2lrf to capture blog archive? Deputy-Dawg Sony Reader Dev Corner 1 02-14-2008 11:41 PM
web2lrf: La Repubblica alexxxm Sony Reader 1 11-13-2007 12:27 PM


All times are GMT -4. The time now is 06:40 AM.


MobileRead.com is a privately owned, operated and funded community.