10-23-2010, 03:14 PM | #31 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
thank you.
sometimes, when i get caught up in something, i for get to explain my self. if you take a look here you will see a list of 30 articles. to see the rest of the articles, you need to go to the bottom of the page and press the next button. then you get an other page with 30 articles. and so on. i used tamper data to find what that button does. it submits a long request with a lot of parameters, but as far as i can see, the only one that matters is "rsSearchRes_pgNo" and you give it the page number you want. how can i incorporate that in my code? also, when i am done with this, i want to turn this recipe in to real python code so i can deal with the pdf articles. how hard do you think that might be? (i tried to get started on that, ran in to some trouble and posted a question on stack overflow. all i got was a nasty response that didnt answer the question) |
10-23-2010, 06:46 PM | #32 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
Advert | |
|
10-24-2010, 01:28 AM | #33 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
all the pages have the same url.
and i have no way to know how meny pages there are. Last edited by marbs; 10-24-2010 at 01:31 AM. |
10-24-2010, 08:20 AM | #34 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
10-24-2010, 02:28 PM | #35 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
i read a few examples and i think i can write the function it self.
i am not sure i know how to use it. or how to call on it. i got this far: Spoiler:
but now i am lost. i dont know where i am going with this. can someone focus me again? Last edited by marbs; 10-24-2010 at 04:12 PM. |
Advert | |
|
10-25-2010, 10:43 AM | #36 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
def preprocess_html(self, soup): self.append_page(soup, soup.body, 3) return soup The result will be that the recipe will see a single page article with all the content from all the multiple pages before it begins to process that article. Does that help? Last edited by Starson17; 10-25-2010 at 10:49 AM. |
|
10-25-2010, 10:55 AM | #37 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
i think it does help.
ill work on the code and see what comes out. i asked this before, but i think it was missed with all the other stuff going on. how hard would it be to make this script run in python (not in calibre)? i still want to get the pdf files... |
10-25-2010, 11:08 AM | #38 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Calibre is mostly a superset of Python. I'm not sure what you're asking. You can easily run any recipe outside of the GUI with ebook-convert. You can easily import anything you need from Python. You can easily subclass any of the provided classes to override or modify program behavior. You can easily run .py code file with calibre-debug -e outside the GUI. If I understand it, I think you want to do a GET of a pdf file, perhaps run some conversion on it, etc.? I suspect it's possible, but I've never seen it done. I'd just start doing it and solve the problems as they appear. I don't see anything that jumps out at me and says it's impossible, provided you're willing to put in the effort, but I don't know of any stock code that will do all that you might want done (whatever that is?) |
|
10-25-2010, 01:19 PM | #39 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
what i meant is that calibre does 90% of the work for you (i think).
how hard would it be to re-build most of the components that are needed to get this thing up and running? |
10-25-2010, 01:32 PM | #40 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
The source is available. You can easily run Calibre from source and modify it as desired. If you want to build it fresh from source, that's been done, too. I'm not sure why you'd want to, but you can. I can't tell you how many of the multiple libraries Calibre uses that you'd need to run this particular recipe.
|
10-25-2010, 01:47 PM | #41 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
ok. then after i i finish this multipage issue i would like to do that.
while i am working on this, i have an other recipe. the articles have pictures. if there is a picture that is wider than the output file, the text goes over the edge too. is there a way to shrink the picture to fit the output file or at least to stop the text form expanding? |
10-25-2010, 01:53 PM | #42 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
For comics, I often specify : img {max-width:100%; min-width:100%;} This works well in the viewer when read on a wide screen. |
|
10-25-2010, 02:45 PM | #43 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
ill give it a try.
how do i convert unicode to int? do i need struct? is it included in calibre? |
10-25-2010, 07:01 PM | #44 |
Zealot
Posts: 122
Karma: 10
Join Date: Jul 2010
Device: nook
|
this is as far as i got. i dont think i am posting my request correctly. or i may not be reading in correctly.
what i did just before i called append_page in the main program is to find the number of articles. i know i have 30 articles per page so that is the explanation for that. hint? Spoiler:
Last edited by marbs; 10-26-2010 at 01:24 AM. |
10-26-2010, 09:44 AM | #45 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
# Log information about HTTP redirects and Refreshes. br.set_debug_redirects(True) # Log HTTP response bodies (ie. the HTML, most of the time). br.set_debug_responses(True) # Print HTTP headers. br.set_debug_http(True) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New recipe | kiklop74 | Recipes | 0 | 10-05-2010 04:41 PM |
New recipe | kiklop74 | Recipes | 0 | 10-01-2010 02:42 PM |
New Title from Book View Cafe: A Princess of Passyunk by Maya Kaathryn Bohnhoff | suelange | Self-Promotions by Authors and Publishers | 0 | 08-11-2010 04:35 PM |
Recipe Help | lrain5 | Calibre | 3 | 05-09-2010 10:42 PM |
Recipe Help Please | estral | Calibre | 1 | 06-11-2009 02:35 PM |