I was working off the stable recipe included in the Calibre source code, i.e.
https://bitbucket.org/khromov/calibr...cipe?at=master. In the middle of the parse_index method there's
Code:
for item in soup.findAll('div', attrs={'class':'cornerControls'}):
and that's where you can simply plug in 'title_row' instead.
I see the code you posted in the dev version. I have not tried running this recipe, so this suggestion is going off a desk read only. I hope this helps, but it's an idea for further development rather than something I expect to actually work. If you fix it up, you can share the results.
In parse_index (as are all the changes), change
Code:
items = soup.findAll('a', attrs={'class':'actionButton textButton'})
to
Code:
article_inner_items = soup.findAll('div', attrs={'class': 'article_inner_item'})
items = [title_row.find('a') for title_row in article_inner_items.find('div', attrs={'class': 'title_row'})]
Change
Code:
archive = item.parent.find('a', attrs={'class':'actionButton archiveButton'})
to
Code:
archive = item.parent.parent.find('a', attrs={'class': 'action_link archive_button'})
The description and date aren't in the same place now, so replace the whole block that started with
with:
Code:
article['description'] = item.parent.parent.find('span', attrs={'class': 'host'}).string.strip()
article['date'] = self.parse_instapaper_date(item.parent.parent.find('span', attrs={'class': 'meta_date'}).string.strip())
The summary:
Code:
summary = item.parent.parent.find('div', attrs={'class':'summary'})
merely changed to a "preview":
Code:
summary = item.parent.parent.find('div', attrs={'class':'article_preview'})
That's all I see. If you're comfortable debugging recipes, see how far that gets you.
For Krittika or anyone else who doesn't use Instapaper, here's what an article on the new feed page looks like:
Code:
<div class="article_item" data-article-id="409202621">
<div class="article_inner_item">
<div class="title_row">
<a href="/read/409202621"
>Why Draper University Won’t Work (But Could)</a>
</div>
<div class="title_meta">
<span class="host">
<a href="http://calnewport.com/blog/2013/08/28/why-draper-university-wont-work-but-could/">
<span>
calnewport.com
</span>
<i class="externalLink icon-circle-arrow-right"></i>
</a>
</span>
· by Study Hacks
</div>
<div class="primary_actions">
<a href="/star_toggle/409202621" class="action_link star_toggle ">
<span class="icon icon-like"></span>
</a>
<a title="Archive" class="action_link archive_button" id="skip409202621" href="/skip/409202621" title="Archive">
<span class="icon icon-drawer"></span>
</a>
</div>
<div class="article_preview">
School for Heroes
Every morning, the students at the Draper University School for Heroes recite an oath:
“I will promote freedom at all costs.”
“I will do…
</div>
<div class="article_item_footer group">
<div class="mobile_options">
<span>hide </span></a>options
</div>
<div class="meta">
<span class="meta_date">8/29</span>
· <span class="meta_read_time">2 min</span>
</div>
<div class="secondary_actions group">
<div class="menu_container share_container">
<a class="action_link" href="#"><i class="icon-share"></i><span>share</span></a>
<div class="action_menu share_menu">
<div class="menu_options">
<div class="menu_inner">
<a class="menu_item emailShare shareOut" id="shareToEmail" href="mailto:?subject=Why Draper University Won’t Work (But Could)&body=Why+Draper+University+Won%E2%80%99t+Work+%28But+Could%29%0Ahttp%3A%2F%2Fcalnewport.com%2Fblog%2F2013%2F08%2F28%2Fwhy-draper-university-wont-work-but-could%2F%0A%0A(via%20Instapaper)">
<i class="icon-envelope"></i> <span>Email</span>
</a>
</div>
</div>
</div>
</div>