|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#31 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
Quote:
I personally am more of a uncategorized person ![]() Since the original recipe left out uncategorized items, I took it to be an obvious flaw. I thought just duplicating the posts was not enough of a point to keep separate recipes as there is not that much of a size issue and this way the classification work more like 'tag's instead of 'folders' i.e one item can have more then one tag. In any case it doesn't hurt to keep both the recipes. I will update my first post to include both updated versions as well as link to your excellent post so people can choose the right one and learn to be better organized. ![]() Thinking about it, for users like me who add/remove feeds like mad and have 200 unread items every day, this also opens the door to fetch only selected feeds. Just have the ones you want to read tagged and leave the others untagged and use the 'Google reader' recipe. -EDIT------------------------------------------------------------------- On second thought, is it possible to give the user a checkbox from a recipe, just like we allow them to enter username/password? For e.g a checkbox saying "Download all articles including uncategorized". This would also be helpful for the feature i want to add at some point, i.e a checkbox to enable marking downloaded articles as read so that they are not re-downloaded in the next news fetch. Quote:
It doesnt hurt by being present and it already the border value so lets leave it in. Last edited by rollercoaster; 07-14-2010 at 07:39 AM. |
||
![]() |
![]() |
![]() |
#32 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
If you or dwanthny will test the second version and confirm it works, I'd say it's ready to go to Kovid for inclusion in the next update.
|
![]() |
![]() |
![]() |
#33 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
At the moment its not possible for users to do GUI based customization of recipes, other than for username password and a couple of items in advanced.
|
![]() |
![]() |
![]() |
#34 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Thanks to Starson17 and rollercoaster, nice team effort. ![]() |
|
![]() |
![]() |
![]() |
#35 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Updated, thanks.
|
![]() |
![]() |
![]() |
#36 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#37 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
Quote:
![]() Quote:
I am just an extra pair of eyes on this one. You did great. Do you think you are up for adding another feature to this recipe i.e to mark downloaded posts as read? Assuming more people then just me would like to see that happen. Last edited by rollercoaster; 07-14-2010 at 11:43 PM. |
||
![]() |
![]() |
![]() |
#38 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
I should warn that my todo list has a few things on it and I'm really slow. I only tackled this because it looked easy (Ha!), and I was one of the few people who'd already written a recipe that changed headers. (I'm still trying to figure out why my first header control method failed. I went back and tested my earlier recipe with both header control methods, and both worked. I don't yet know why only the second one worked for Google Reader.) |
|
![]() |
![]() |
![]() |
#39 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
![]() Quote:
Quote:
May be we should ask the other devs to add support for checkboxes or a dropdown of options in recipes as it is possible that some users will not like the idea of marking the posts read. It would be great to have that option under user control but I dont know how hard it will be from a code point of view. We only need to store and read the state of the checkbox/dropdown/other controls. May be you can contact someone who can give an informed answer. Last edited by rollercoaster; 07-16-2010 at 03:07 AM. |
||
![]() |
![]() |
![]() |
#40 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
Well it appears there are two methods to do this. The first is straight forward. Lets try it...
After all feeds have been processed, make a GET request to "http://www.google.com/reader/atom/user/-/state/com.google/reading-list?n=1" and from the received XML(see Reference Feed structure) extract the feed id and timestamp values. Then POST to "http://www.google.com/reader/api/0/mark-all-as-read" with the data "s=<Feed ID>&ts=<TimeStamp in microseconds>&T=<token>" (may need to URI encode values) Note that this must be done AFTER the articles have been processed/saved as they cannot be downloaded again after successfully marking all as read. If possible, do it after the ebook as been generated and saved successfully so that conversion or other external errors done mess this up. Reference Feed structure: Code:
<feed> ... <id> tag:google.com,2005:reader/user/10347379608328268864/state/com.google/reading-list </id> ... <entry gr:crawl-timestamp-msec="1279242802553"> ... </entry> </feed> To get the Feed ID: read value at <feed><id>[VALUE]<id>....</feed> XPATH = //feed/id To get the Time Stamp: read value at <feed><entry gr:crawl-timestamp-msec="[VALUE]"></entry>....</feed> XPATH=//feed/entry[1]/[crawl-timestamp-msec] Note 1: we only need the time stamp of the FIRST <entry> Note 2: The value in the feeds is in millisecond but for the "mark-all-as-read" we need microsecond. So to get the right value do this: Microsecond_Time_Stamp = ((MiliSecond_Time_Stamp + 1) * 1000) -1 To get Token value Execute a GET request for "http://www.google.com/reader/api/0/token" and read the response. it is a 57 chars string. Final Note 1: All and any requests must include the "Authorization=GoogleLogin auth=<AUTH TOKEN>" header. ------------------------ if this doesnt work then we will have to try the other method that will be more complicated as low performing. I.e. mark individual items as read. Last edited by rollercoaster; 07-16-2010 at 05:31 AM. |
![]() |
![]() |
![]() |
#41 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#42 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
For example: Quote:
Here's another problem: Quote:
Sorry to disappoint you, but I'm going to focus on a couple of other things of interest to me in Calibre code. |
|||
![]() |
![]() |
![]() |
#43 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jul 2010
Device: kindle dx
|
I need to download all starred feeds (read and unread), not only the last 20 entries.
Is it possible? |
![]() |
![]() |
![]() |
#44 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
![]() |
![]() |
![]() |
#45 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 126
Karma: 1826
Join Date: Jan 2010
Device: Kindle 2
|
Quote:
pass a data keyword argument to urllib.urlopen: u = urllib.urlopen('http://www.domain.com/cgi-bin/cgi.py', data=urllib.urlencode({'name': 'pythonguy'})) POST is the way to submit form data. For e.g. Username password forms. The main difference with GET (any normal read url request) is that the parameters are submitted as multi-part form-data instead of in the query string and are not limited in size as URLs usually are. Quote:
Thanks very much for you time though. May be we can pick this up later sometime. Recipes could do with more advanced features like additional UI elements and more control over the whole fetch process. |
||
![]() |
![]() |
![]() |
Tags |
google reader, google reader uber, hack, recpie |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Google Reader recipe not working :( | techie_007 | Calibre | 1 | 01-26-2010 09:58 PM |
Tagging and deleting for Google Reader Recipe | jomaweb | Calibre | 14 | 01-26-2010 11:31 AM |
Recipe Google Reader vs Google Reader Uber | DoctorOhh | Calibre | 0 | 01-26-2010 04:37 AM |
Google Uber Recipe takes so much time | jomaweb | Calibre | 1 | 01-26-2010 03:21 AM |
Read O'Reilly Hacks Series books using Google hack | Brian | Lounge | 12 | 02-19-2009 03:17 PM |