def get_metadata_description(soup): og_desc = get_og_property(soup, 'description') if og_desc: return og_desc tw_desc = get_twitter_property(soup, 'description') if tw_desc: return tw_desc meta_desc = get_meta_property(soup, 'description') if not meta_desc: meta_desc = get_meta_property(soup, 'Description') if meta_desc: return meta_desc return ''
def get_description(soup, feed): og_desc = get_og_property(soup, 'description') if og_desc: return og_desc tw_desc = get_twitter_property(soup, 'description') if tw_desc: return tw_desc meta_desc = get_meta_property(soup, 'description') if meta_desc: return meta_desc return clean_html(feed.description)
def get_title(soup, feed): og_title = get_og_property(soup, 'title') if og_title: return og_title tw_title = get_twitter_property(soup, 'title') if tw_title: return tw_title meta_title = get_meta_property(soup, 'title') if meta_title: return meta_title return clean_html(feed.title)
def get_metadata_title(soup): og_title = get_og_property(soup, 'title') if og_title: return og_title tw_title = get_twitter_property(soup, 'title') if tw_title: return tw_title meta_title = get_meta_property(soup, 'title') if meta_title: return meta_title if soup: if soup.find('title'): return soup.find('title').get_text() return ''