def get_posts(conf): rows = [] for url in conf['urls']: tree = retry_get_tree(url) rows = tree.xpath('//div[@id="siteTable"]/div') rows.extend([process_item_fn(row, conf) for row in rows]) return rows
def get_posts(conf): rows = [] for url in conf['urls']: tree = retry_get_tree(url) rows = tree.xpath('//li[@class="repo-list-item"]') rows.extend([process_item_fn(row) for row in rows]) return rows
def get_posts(conf): rows = [] for url in conf['urls']: tree = retry_get_tree(url) rows = tree.xpath('//div[contains(@id, "question-summary")]') rows.extend([process_item_fn(row) for row in rows]) return rows
def get_repo_page(link): print(link, 1) tree = retry_get_tree(link) stars = tree.xpath( '//a[@class="social-count js-social-count"]')[0].text.strip().replace(',', '') desc = tree.xpath('//article//p') return {'likes': {'at': datetime.datetime.now().isoformat()[:19], 'n': int(stars)}, 'description2': desc[0].text_content() if desc else ''}
def get_posts(conf): posts = [] for handle in conf['twitter_handles']: print(handle) conf['url'] = 'https://twitter.com/{}'.format(handle) tree = retry_get_tree(conf['url']) rows = tree.xpath('//li[contains(@class, "js-stream-item")]') posts.extend([process_item_fn(row) for row in rows]) return posts
def get_repo_page(link): print(link, 1) tree = retry_get_tree(link) stars = tree.xpath( '//a[@class="social-count js-social-count"]')[0].text.strip().replace( ',', '') desc = tree.xpath('//article//p') return { 'likes': { 'at': datetime.datetime.now().isoformat()[:19], 'n': int(stars) }, 'description2': desc[0].text_content() if desc else '' }
def get_posts(conf): tree = retry_get_tree(conf['url']) rows = tree.xpath('//div[contains(@id, "question-summary")]') rows = [process_item_fn(row) for row in rows] return rows
def get_posts(conf): tree = retry_get_tree(conf['url']) rows = tree.xpath('//li[@class="repo-list-item"]') rows = [process_item_fn(row) for row in rows] return rows
def get_posts(conf): tree = retry_get_tree(conf['url']) rows = tree.xpath('//div[@id="siteTable"]/div') rows = [process_item_fn(row) for row in rows] return rows
def get_posts(conf): tree = retry_get_tree(conf["url"]) rows = tree.xpath('//div[@id="siteTable"]/div') rows = [process_item_fn(row) for row in rows] return rows