回答編集履歴
2
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
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は
|
7
|
+
# このときstatusオブジェクトはリツイートを指す。
|
5
|
-
|
8
|
+
api.destroy_status(status.id)
|
6
9
|
```
|