當前位置: 首頁>>代碼示例>>Python>>正文


Python Scrobbler.scrobble方法代碼示例

本文整理匯總了Python中scrobbler.Scrobbler.scrobble方法的典型用法代碼示例。如果您正苦於以下問題:Python Scrobbler.scrobble方法的具體用法?Python Scrobbler.scrobble怎麽用?Python Scrobbler.scrobble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在scrobbler.Scrobbler的用法示例。


在下文中一共展示了Scrobbler.scrobble方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: rc

# 需要導入模塊: from scrobbler import Scrobbler [as 別名]
# 或者: from scrobbler.Scrobbler import scrobble [as 別名]
    limits = {
        'NA': (3000, 'orange', 'North America'),
        'EU': (10000, 'blue', 'Europe'),
        'RU': (30000, 'red', 'Russia'),
        'ASIA': (1000, 'green', 'Asia'),
        'KR': (500, 'purple', 'Korea'),
    }
    rc('font', **{'family':'serif'})
    for server in ['EU', 'NA', 'RU', 'ASIA', 'KR']:
        print server
        # scrob = Scrobbler(min_points=5000, max_pages=90, max_rank=90000, max_players=90000)
        scrob = Scrobbler(min_points=5000, max_pages=90, max_rank=90000, max_players=90000)
        scrob.page_size = 1000
        scrob.build_headers(server)
        try:
            data = scrob.scrobble()

            x = []
            y = []

            for player in scrob.ranking:
                x.append(scrob.players[player[0]]['real_position'])
                y.append(player[1])

                if scrob.players[player[0]]['real_position'] == limits[server][0]:
                    cutoffx = [limits[server][0], limits[server][0]]
                    cutoffy = [0, player[1]]

                    plot(cutoffx, cutoffy, color=limits[server][1], label="_"+str(player[1]))
                    text(limits[server][0], int(player[1]/2), server+' '+str(int(player[1])), verticalalignment='top',
                         fontsize=10, color=limits[server][1])
開發者ID:nicwest,項目名稱:famepoints,代碼行數:33,代碼來源:graph.py


注:本文中的scrobbler.Scrobbler.scrobble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。