|
|
#1 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
The week(India) update
https://github.com/kovidgoyal/calibr...he_week.recipe
present recipe doesn't work anymore and the feeds aren't updated regularly from their side. |
|
|
|
|
|
#2 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
another update
update eenadu https://github.com/kovidgoyal/calibr.../eenadu.recipe
To remove older articles add Code:
from datetime import date, datetime, timedelta
from calibre.utils.date import parse_date
def preprocess_html(self, soup):
div = soup.find('div', **classes('pub-t'))
if div:
date = parse_date(
self.tag_to_string(div)
.strip().replace('Published : ','').replace('Updated : ','').replace(' IST',':00.000001')
).replace(tzinfo=None)
today = datetime.now()
if (today - date) > timedelta(1.5):
self.abort_article('Skipping old article')
else: # may not be an artilce.
self.abort_article()
return soup
Code:
# Finding all the section titles that are acceptable
for x in nav_div.findAll(['a']):
if self.is_accepted_entry(x):
sec = self.tag_to_string(x)
link = x['href']
if link.endswith('telangana'):
sec = 'తెలంగాణ'
if link.endswith('andhra-pradesh'):
sec = 'ఆంధ్రప్రదేశ్'
if link.endswith('andhra-pradesh/districts'):
sec = 'ఆంధ్రప్రదేశ్.. ఆసక్తికర జిల్లా వార్తలు'
if link.endswith('telangana/districts'):
sec = 'తెలంగాణ.. ఆసక్తికర జిల్లా వార్తలు'
section_list.append((sec, link))
feeds = []
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 85520
Join Date: May 2021
Device: kindle
|
https://github.com/kovidgoyal/calibr...a_today.recipe
India today .. better cover url Code:
def get_cover_url(self):
soup = self.index_to_soup('https://www.readwhere.com/magazine/the-india-today-group/India-Today/1154')
for citem in soup.findAll('meta', content=lambda s: s and s.endswith('/magazine/300/new')):
return citem['content'].replace('300', '600')
cover url isn't updated in the old link Code:
def get_cover_url(self):
soup = self.index_to_soup('https://openthemagazine.com/')
tag = soup.find(attrs={'class': 'magazine-item mr-1'})
if tag:
self.cover_url = tag.find('img')['src']
return getattr(self, 'cover_url', self.cover_url)
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Update India Today | unkn0wn | Recipes | 8 | 07-25-2022 05:11 AM |
| Can anyone do 'The Week' and 'India Today' WeeklyMagazine recipes. No login required. | unkn0wn | Recipes | 0 | 06-11-2021 06:39 AM |
| Caravan Magazine India Error In The New Update | abhix3 | Recipes | 2 | 07-18-2020 11:43 PM |
| Touch I'm from India and want to buy nook but heard that can't use it in India | nandini | Barnes & Noble NOOK | 11 | 10-15-2012 08:54 AM |
| Nook eInk getting a "major update" (v1.5) update next week | =X= | News | 3 | 11-16-2010 01:54 PM |