如何创建 Twitter::Tweet 实例以创建 retweeted

编程入门 行业动态 更新时间:2024-10-27 17:12:54
本文介绍了如何创建 Twitter::Tweet 实例以创建 retweeted_by_user的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想打电话给 retweeted_by_user(user, options = {}).如何创建对象 Twitter::Tweet(在 Twitter::REST::Timelines 模块中)的实例来调用此方法.是实例方法,对吗?

I want to call retweeted_by_user(user, options = {}). How do I create instance of object Twitter::Tweet (in Twitter::REST::Timelines module) to call this method. It is instance method, correct?

我是为 Twitter::REST::CLIENT 做的

I did this for Twitter::REST::CLIENT

 client = client = Twitter::REST::Client.new do |config|
  config.consumer_key     = "..."
  config.consumer_secret  = "..."
  config.access_token     = "..."
  config.access_token_secret = "..."
end

但它不适用于 Twitter::Tweet

but it does not work for Twitter::Tweet

 client = client = Twitter::Tweet.new do |config|
  config.consumer_key     = "..."
  config.consumer_secret  = "..."
  config.access_token     = "..."
  config.access_token_secret = "..."
end

这里是 Twitter gem 的文档.我需要多一点解释http://rdoc.info/gems/twitter/Twitter/REST/Timelines#retweeted_by_user-instance_method

Here are the docs for Twitter gem. I need a little more explanation http://rdoc.info/gems/twitter/Twitter/REST/Timelines#retweeted_by_user-instance_method

推荐答案

spec 是最好的文档和解释:

spec are the best documentation and explanation:

客户:https://github/sferik/twitter/blob/c9cfca9bf156ac0569d6c2cd7117327daf10a643/spec/twitter/rest/timelines_spec.rb#L6

方法用法:https://github/sferik/twitter/blob/c9cfca9bf156ac0569d6c2cd7117327daf10a643/spec/twitter/rest/timelines_spec.rb#L58

这篇关于如何创建 Twitter::Tweet 实例以创建 retweeted_by_user的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 15:34:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1192052.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实例   Twitter   Tweet   retweeted

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!