teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

6

些細

2019/08/29 09:11

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -26,4 +26,4 @@
26
26
  for user_id in tweepy.Cursor(api.followers_ids, id=target_id, cursor=-1).items():
27
27
  print(user_id, file=f)
28
28
  ```
29
- のようにすれば「15分間に5000件を15回、最大75,000件獲得」になりますね。
29
+ のようにすれば「15分間に5000件を15回、最大75,000件、IDのみを獲得」になりますね。

5

誤解のないように修正

2019/08/29 09:11

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -10,10 +10,12 @@
10
10
  質問のソースの
11
11
  ```python
12
12
  followers_ids = tweepy.Cursor(api.followers_ids, id = target_id, cursor = -1).items()
13
+
14
+ for followers_id in followers_ids:
13
15
  ```
14
16
  **この部分(=followers/ids)に対する**実行の制限が「15分に15回」で「API実行1回につき5,000件」までです。 [APIリファレンス](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids#resource-information)
15
17
 
16
- 今ここで`target_id`指定が1つですから、そのアカウントのフォロワーが5,000より多い時にこの部分でAPIが複数回実行されます。しかしながら、下の`api.get_user(...)`の回数制限の方がきついのでfollowers/idsの制限は一切問題になりません。
18
+ `target_id`指定されたアカウントのフォロワーが5,000より多い時にこの部分でAPIが複数回実行されます。
17
19
 
18
20
  ----
19
21
 

4

コードの体裁の修正

2019/08/29 09:07

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -19,10 +19,9 @@
19
19
 
20
20
  たとえば
21
21
  ```python
22
- followers_ids = tweepy.Cursor(api.followers_ids, id = target_id, cursor = -1).items()
23
22
 
24
23
  with open('xxxxxxxx.followers.txt', 'a') as f:
25
- for user_id in followers_ids:
24
+ for user_id in tweepy.Cursor(api.followers_ids, id=target_id, cursor=-1).items():
26
25
  print(user_id, file=f)
27
26
  ```
28
27
  のようにすれば「15分間に5000件を15回、最大75,000件獲得」になりますね。

3

些細

2019/08/29 08:29

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -25,4 +25,4 @@
25
25
  for user_id in followers_ids:
26
26
  print(user_id, file=f)
27
27
  ```
28
- のようにすれば「15分間に5000件を15回、75,000件獲得」になりますね。
28
+ のようにすれば「15分間に5000件を15回、最大75,000件獲得」になりますね。

2

些細

2019/08/29 08:14

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -8,7 +8,7 @@
8
8
  コメントに対して
9
9
 
10
10
  質問のソースの
11
- ```
11
+ ```python
12
12
  followers_ids = tweepy.Cursor(api.followers_ids, id = target_id, cursor = -1).items()
13
13
  ```
14
14
  **この部分(=followers/ids)に対する**実行の制限が「15分に15回」で「API実行1回につき5,000件」までです。 [APIリファレンス](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids#resource-information)

1

追記

2019/08/29 08:06

投稿

quickquip
quickquip

スコア11314

answer CHANGED
@@ -2,4 +2,27 @@
2
2
 
3
3
  Requests / 15-min window (user auth) 900
4
4
 
5
- Twitter API が15分に900回までしか受け付けないのでそれが上限です。
5
+ Twitter API が15分に900回までしか受け付けないのでそれが上限です。
6
+
7
+ ----
8
+ コメントに対して
9
+
10
+ 質問のソースの
11
+ ```
12
+ followers_ids = tweepy.Cursor(api.followers_ids, id = target_id, cursor = -1).items()
13
+ ```
14
+ **この部分(=followers/ids)に対する**実行の制限が「15分に15回」で「API実行1回につき5,000件」までです。 [APIリファレンス](https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids#resource-information)
15
+
16
+ 今ここで`target_id`の指定が1つですから、そのアカウントのフォロワーが5,000より多い時にはこの部分でAPIが複数回実行されます。しかしながら、下の`api.get_user(...)`の回数制限の方がきついのでfollowers/idsの制限は一切問題になりません。
17
+
18
+ ----
19
+
20
+ たとえば
21
+ ```python
22
+ followers_ids = tweepy.Cursor(api.followers_ids, id = target_id, cursor = -1).items()
23
+
24
+ with open('xxxxxxxx.followers.txt', 'a') as f:
25
+ for user_id in followers_ids:
26
+ print(user_id, file=f)
27
+ ```
28
+ のようにすれば「15分間に5000件を15回、計75,000件獲得」になりますね。