I just got a new Kindle yesterday and have been playing around to see how it's going to work with replacing my iPod for reading news and blogs. Calibre makes it pretty easy to stay up-to-date, but there is one thing that's bugging me and that's finding out when news items were posted in my RSS feeds. I am not interested in the whole feed's publication date - or the date that the ebook is generated - i would like to see each news item's publication date next to its title. I would like to see something like this:
Article Title posted 2011-02-04 11:30:23
Article text.
Here is what i tried for a first attempt:
Code:
def populate_article_metadata(self, article, soup, first):
time = NavigableString(article.localtime.strftime("%Y-%m-%d %H:%M:%S"))
p = Tag(soup, 'p')
em = Tag(soup, 'em')
soup.insert(0, p)
p.insert(0, em)
em.insert(0, time)
(I am assuming that the contents of the RSS item pubDate tag is automatically put into the date/utctime/localtime fields of the Article class.)
I know i'm using this method for the opposite of what is intended - i'm updating the soup from the article rather than the article from the soup, but i thought it would still work. Unfortunately it doesn't. I even tried just inserting some static test text and it didn't work either, which leads me to believe that "soup" isn't a pointer to but a copy of the data that is used to create the ebook text. Is there any other way to access the article object so i can pull metadata out and put it into the ebook text (e.g. in postprocess_html)?
On a side note, is there any way to quickly test a recipe from the command-line? It is pretty painful to click around the UI to do it every time something small gets changed. The command line would also be helpful for debug messages. I'm running Mac OS.
Thanks everyone.