コード例 #1
0
def scrapeMainPage(connection=None):
    if connection is None:
        connection = BTCEConnection()

    parser = BTCEScraper()

    # Rotate through the currency pairs between chat requests so that the
    # chat pane contents will update more often than every few minutes.
    global _current_pair_index
    _current_pair_index = (_current_pair_index + 1) % len(all_pairs)
    current_pair = all_pairs[_current_pair_index]

    response = connection.makeRequest('/exchange/%s' % current_pair,
                                      with_cookie=True)

    parser.feed(parser.unescape(response.decode('utf-8')))
    parser.close()

    r = ScraperResults()
    r.messages = parser.messages
    r.devOnline = parser.devOnline
    r.supportOnline = parser.supportOnline
    r.adminOnline = parser.adminOnline

    return r
コード例 #2
0
ファイル: scraping.py プロジェクト: AllanStark/btce-api
def scrapeMainPage(connection=None):
    if connection is None:
        connection = BTCEConnection()

    parser = BTCEScraper()

    # Rotate through the currency pairs between chat requests so that the
    # chat pane contents will update more often than every few minutes.
    global _current_pair_index
    _current_pair_index = (_current_pair_index + 1) % len(all_pairs)
    current_pair = all_pairs[_current_pair_index]

    parser.feed(connection.makeRequest('/exchange/%s' % current_pair))
    parser.close()

    r = ScraperResults()
    r.messages = parser.messages
    r.reserves24change = parser.reserves24change
    r.reservesALFAcashier = parser.reservesALFAcashier
    r.usersOnline = parser.usersOnline
    r.botsOnline = parser.botsOnline
    r.devOnline = parser.devOnline
    r.supportOnline = parser.supportOnline
    r.adminOnline = parser.adminOnline

    return r
コード例 #3
0
ファイル: scraping.py プロジェクト: chuckatkins/btce-api
def scrapeMainPage(connection=None):
    if connection is None:
        connection = BTCEConnection()

    parser = BTCEScraper()

    # Rotate through the currency pairs between chat requests so that the
    # chat pane contents will update more often than every few minutes.
    global _current_pair_index
    _current_pair_index = (_current_pair_index + 1) % len(all_pairs)
    current_pair = all_pairs[_current_pair_index]

    parser.feed(connection.makeRequest('/exchange/%s' % current_pair))
    parser.close()

    r = ScraperResults()
    r.messages = parser.messages
    r.bitInstantReserves = parser.bitInstantReserves
    r.aurumXchangeReserves = parser.aurumXchangeReserves

    return r