4
任何人都知道为什么下面的游标在下面的代码中没有改变?Ruby:Twitter API:获取所有关注者
cursor = "-1"
followerIds = []
while cursor != 0 do
followers = Twitter.follower_ids("IDTOLOOKUP",{"cursor"=>cursor})
cursor = followers.next_cursor
followerIds+= followers.ids
sleep(2)
end
在cursor = -1的第一次迭代之后,它会从twitter api分配nextcursor。然而,当它在后续迭代中发送到Twitter API时,我得到的回应与我第一次相同 - 使用相同的next_cursor。
任何想法我做错了什么?我正在使用twitter gem。
认为最初也是如此。但不是。剩下很多。 – RekrowYnapmoc 2010-12-22 02:32:58