From 9a449bf3ca1f8a2864f6075b2c96d933294643d4 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 7 Jul 2020 20:55:13 +0000 Subject: [PATCH] Remove extra logging --- apiserver/feed.py | 9 --------- apiserver/feeds/tildes.py | 6 ------ 2 files changed, 15 deletions(-) diff --git a/apiserver/feed.py b/apiserver/feed.py index 87612b0..991b7b2 100644 --- a/apiserver/feed.py +++ b/apiserver/feed.py @@ -83,41 +83,32 @@ def update_story(story, is_manual=False): elif story['source'] == 'manual': res = manual.story(story['ref']) - logging.info('Got story') - if res: story.update(res) # join dicts else: logging.info('Story not ready yet') return False - logging.info('story joined') - if story['date'] and not is_manual and story['date'] + TWO_DAYS < time.time(): logging.info('Story too old, removing') return False - logging.info('story age good') - if story.get('url', '') and not story.get('text', ''): logging.info('inside if') if not get_content_type(story['url']).startswith('text/'): logging.info('URL invalid file type / content type:') logging.info(story['url']) return False - logging.info('content type good') if any([domain in story['url'] for domain in INVALID_DOMAINS]): logging.info('URL invalid domain:') logging.info(story['url']) return False - logging.info('domain good') logging.info('Getting article ' + story['url']) story['text'] = get_article(story['url']) if not story['text']: return False - logging.info('returning true') return True if __name__ == '__main__': diff --git a/apiserver/feeds/tildes.py b/apiserver/feeds/tildes.py index 920c751..3b7051a 100644 --- a/apiserver/feeds/tildes.py +++ b/apiserver/feeds/tildes.py @@ -73,14 +73,10 @@ def story(ref): html = api(API_ITEM(ref)) if not html: return False - logging.info('Got Tildes html') - soup = BeautifulSoup(html, features='html.parser') a = soup.find('article', class_='topic-full') if a is None: return False - logging.info('Got article tag') - h = a.find('header') lu = h.find('a', class_='link-user') @@ -106,8 +102,6 @@ def story(ref): ch = a.find('header', class_='topic-comments-header') s['num_comments'] = int(ch.h2.string.split(' ')[0]) if ch else 0 - logging.info('Parsed html data') - if s['score'] < 8 and s['num_comments'] < 6: return False