2013-07-26 38 views
0
api = twitter.Api(consumer_key='aaa',consumer_secret='aaa', access_token_key='aaa', access_token_secret='aaa') 

followers=api.GetFollowerIDs() 

該代碼在4天前工作。但突然停下來工作。它在下面給出錯誤。我正在使用python-twitter。這是什麼原因?GetFollowerIDs函數不再工作

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/usr/local/lib/python2.7/dist-packages/python_twitter-1.0.1-py2.7.egg/twitter.py", line 3320, in GetFollowerIDs 
    total_count -= len(data['ids']) 
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int' 

編輯:所有的代碼是上方。這是3-4天前正確的工作代碼。

編輯2:如果你想你可以從這裏看錯誤行。我正在使用該庫。 https://github.com/bear/python-twitter/blob/master/twitter.py

+0

一般情況下,這樣的錯誤是實現和API之間的不同步可能的候選人。你是否檢查過Twitters更新日誌,以查看最近是否有任何更改? –

+0

它似乎你的total_count是一個你可以發佈其餘的代碼嗎? –

回答

0

這裏發生的事情:

a = None 
a -= 5 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int' 

由於某種原因,你total_count變量設置爲無