예제 #1
0
def get_badges(page):
    stlib.logger.info('Getting badges from page %d', page)
    profile = stlib.steam_profile()
    html = stlib.network.try_get_html('steam',
                                      '{}/badges/?p={}'.format(profile, page))

    return html.findAll('div', class_='badge_title_row')
예제 #2
0
def get_badge_page_count():
    stlib.logger.info('Counting badge pages')
    profile = stlib.steam_profile()
    html = stlib.network.try_get_html('steam', '{}/badges/'.format(profile))

    try:
        page_count = int(html.findAll('a', class_='pagelink')[-1].text)
    except IndexError:
        page_count = 1

    return page_count
예제 #3
0
def get_badge_page_count():
    stlib.logger.info('Counting badge pages')
    profile = stlib.steam_profile()
    html = stlib.network.try_get_html('steam', '{}/badges/'.format(profile))

    try:
        page_count = int(html.findAll('a', class_='pagelink')[-1].text)
    except IndexError:
        page_count = 1

    return page_count
예제 #4
0
def get_card_count(badge, update_from_web=False):
    game_name = get_game_name(badge)
    game_id = get_game_id(badge)

    if update_from_web:
        stlib.logger.verbose('Updating number of cards of %s(%s)', game_name, game_id)
        profile = stlib.steam_profile()
        html = stlib.network.try_get_html('steam', '{}/gamecards/{}'.format(profile, game_id))
        stats = html.find('div', class_='badge_title_stats_drops')
        progress = stats.find('span', class_='progress_info_bold')
    else:
        stlib.logger.verbose('Getting number of cards of %s(%s)', game_name, game_id)
        progress = badge.find('span', class_='progress_info_bold')

    if not progress or 'No' in progress.text:
        return 0
    else:
        return int(progress.text.split(' ', 3)[0])
예제 #5
0
def get_card_count(badge, update_from_web=False):
    game_name = get_game_name(badge)
    game_id = get_game_id(badge)

    if update_from_web:
        stlib.logger.verbose('Updating number of cards of %s(%s)', game_name,
                             game_id)
        profile = stlib.steam_profile()
        html = stlib.network.try_get_html(
            'steam', '{}/gamecards/{}'.format(profile, game_id))
        stats = html.find('div', class_='badge_title_stats_drops')
        progress = stats.find('span', class_='progress_info_bold')
    else:
        stlib.logger.verbose('Getting number of cards of %s(%s)', game_name,
                             game_id)
        progress = badge.find('span', class_='progress_info_bold')

    if not progress or 'No' in progress.text:
        return 0
    else:
        return int(progress.text.split(' ', 3)[0])
예제 #6
0
def get_badges(page):
    stlib.logger.info('Getting badges from page %d', page)
    profile = stlib.steam_profile()
    html = stlib.network.try_get_html('steam', '{}/badges/?p={}'.format(profile, page))

    return html.findAll('div', class_='badge_title_row')