我可以用 ruby 读取 Twitter 上已删除的状态吗?
我想在 Twitter 上阅读已删除的状态,因为我已经可以使用“on_delete”方法获得已删除状态的 user_id 和 status_id。
这是我的代码:
require 'rubygems'
require 'tweetstream'
TweetStream::Client.new(USER,PASS).follow(3331681,15846407,30592818,21249843,1367531,428333, 196218494,82158673, :delete => Proc.new{ |status_id, user_id| puts "#{status_id}, #{user_id}"}) do |status|
#is it a retweet
rt=!defined?(status.method_missing("retweeted_status",status.id).class).nil?
puts "retweet?:"
puts rt.inspect
if status.in_reply_to_screen_name.nil?
if rt
puts "Retweeted by :#{status.user.screen_name}"
else
puts "Screen name :#{status.user.screen_name}"
end
else
puts "From :#{status.user.screen_name} to #{status.in_reply_to_screen_name}"
end
puts "Text:#{status.text}"
puts "#{status.created_at}"
puts '*' * 7
puts "user id:#{status.user.id}"
puts "to :#{status.in_reply_to_user_id}"
puts '--' * 25
end
I would like to read the deleted statuses on twitter since i can already have the user_id and status_id of the deleted tatus using "on_delete" method.
here is my code:
require 'rubygems'
require 'tweetstream'
TweetStream::Client.new(USER,PASS).follow(3331681,15846407,30592818,21249843,1367531,428333, 196218494,82158673, :delete => Proc.new{ |status_id, user_id| puts "#{status_id}, #{user_id}"}) do |status|
#is it a retweet
rt=!defined?(status.method_missing("retweeted_status",status.id).class).nil?
puts "retweet?:"
puts rt.inspect
if status.in_reply_to_screen_name.nil?
if rt
puts "Retweeted by :#{status.user.screen_name}"
else
puts "Screen name :#{status.user.screen_name}"
end
else
puts "From :#{status.user.screen_name} to #{status.in_reply_to_screen_name}"
end
puts "Text:#{status.text}"
puts "#{status.created_at}"
puts '*' * 7
puts "user id:#{status.user.id}"
puts "to :#{status.in_reply_to_user_id}"
puts '--' * 25
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你不能。这是 Twitter API 的限制,而不是任何 Ruby 库的限制。它曾经是可能的,但后来已被修复,在此过程中破坏了推文恢复服务,例如tweeted.com。
No, you can't. This is a constraint of the Twitter API rather than any Ruby library. It used to be possible but has since been fixed, breaking tweet recovery services such as tweleted.com in the process.