-2
我想取消關注所有的人,我跟隨。 我的代碼有什麼問題?什麼是錯在我的代碼? Tweepy
import tweepy
#unfollow script
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
# llölölöälöä
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
def unfollow():
print("[+] Unfollowing in progress...")
for user in api.followers():
api.destroyfriendship(user)
test = input("Type ENTER if you want to start.")
test = True
if test is True:
unfollow()
else:
print("Thanks for using my script")
AttributeError的:「API」對象有沒有屬性「destroyfriendship」
嘗試'destroy_friendship'代替。參見[這裏](http://docs.tweepy.org/en/v3.5.0/api.html#API.destroy_friendship) – 2017-01-02 14:19:05
比我得到錯誤414 – leisureTheo
該方法被調用適當所以你的問題就解決了。如果你正面臨另一個問題,打開一個新的問題。 – 2017-01-02 14:27:22