Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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 ''}
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
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 ''
    }
Ejemplo n.º 8
0
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
Ejemplo n.º 9
0
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
Ejemplo n.º 10
0
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
Ejemplo n.º 11
0
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
Ejemplo n.º 12
0
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
Ejemplo n.º 13
0
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