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

回答編集履歴

2

2021/02/26 13:16

投稿

退会済みユーザー
answer CHANGED
@@ -5,5 +5,7 @@
5
5
  for status in tweepy.Cursor(api.user_timeline).items():
6
6
  if "RT" in status.text:
7
7
  # このときstatusオブジェクトはリツイートを指す。
8
+ print(status.text)
8
9
  api.destroy_status(status.id)
10
+ print("Unretweeted.")
9
11
  ```

1

2021/02/26 13:16

投稿

退会済みユーザー
answer CHANGED
@@ -1,6 +1,9 @@
1
1
  取り消したいretweetのstatus.idを指定して、destroy_statusするだけです。
2
2
  通常のツイートの削除の作法と変わりません。
3
+ 質問中のコードは、自分の**リツイート**を指定できていないからエラーになっているのだと思います。
3
4
  ```
5
+ for status in tweepy.Cursor(api.user_timeline).items():
6
+ if "RT" in status.text:
4
- # statusはretweetを指しているものと
7
+ # このときstatusオブジェクトリツイートを指す。
5
- api.destroy_status(status.id)
8
+ api.destroy_status(status.id)
6
9
  ```