回答編集履歴

3

fix link

2016/10/25 04:49

投稿

hana-da
hana-da

スコア1728

test CHANGED
@@ -1,4 +1,4 @@
1
- こちらでどうぞ。 [Method: Twitter::REST::Tweets#retweets](http://www.rubydoc.info/gems/twitter/Twitter%2FREST%2FTweets%3Aretweets
1
+ こちらでどうぞ。 [Method: Twitter::REST::Tweets#retweets](http://www.rubydoc.info/gems/twitter/Twitter%2FREST%2FTweets%3Aretweets)
2
2
 
3
3
 
4
4
 

2

add space

2016/10/25 04:49

投稿

hana-da
hana-da

スコア1728

test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  puts "text:" + t.text
26
26
 
27
- puts client.retweets(t)rescue nil
27
+ puts client.retweets(t) rescue nil
28
28
 
29
29
  end
30
30
 

1

例外対応

2016/10/25 01:10

投稿

hana-da
hana-da

スコア1728

test CHANGED
@@ -1 +1,35 @@
1
- こちらでどうぞ。 [Method: Twitter::REST::Tweets#retweets](http://www.rubydoc.info/gems/twitter/Twitter%2FREST%2FTweets%3Aretweets)
1
+ こちらでどうぞ。 [Method: Twitter::REST::Tweets#retweets](http://www.rubydoc.info/gems/twitter/Twitter%2FREST%2FTweets%3Aretweets
2
+
3
+
4
+
5
+ ----
6
+
7
+
8
+
9
+ `Twitter:Error::Forbidden` は、「その操作はあなたに許可されていない」という例外です。
10
+
11
+ tに対してその詳細を見る権限があるかを確認してください。
12
+
13
+
14
+
15
+ とりあえず動かすなら
16
+
17
+
18
+
19
+ ```ruby
20
+
21
+ client.retweets_of_me(count: 10).each do |t|
22
+
23
+ puts "count:" + t.retweet_count.to_s
24
+
25
+ puts "text:" + t.text
26
+
27
+ puts client.retweets(t)rescue nil
28
+
29
+ end
30
+
31
+ ```
32
+
33
+
34
+
35
+ とすれば動くと思います。