回答編集履歴
1
コード修正
test
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
for tweet in data['statuses']:
|
42
42
|
|
43
|
-
|
43
|
+
"""
|
44
44
|
|
45
45
|
if 'entities' in tweet and 'media' in tweet['entities']:
|
46
46
|
|
@@ -54,9 +54,15 @@
|
|
54
54
|
|
55
55
|
print( m['media_url'])
|
56
56
|
|
57
|
-
|
57
|
+
"""
|
58
58
|
|
59
59
|
if 'extended_entities' in tweet and 'media' in tweet['extended_entities']:
|
60
|
+
|
61
|
+
urls = []
|
62
|
+
|
63
|
+
for m in tweet['extended_entities']['media']: # こちらは複数要素(画像)がありえる
|
64
|
+
|
65
|
+
urls.append(m['media_url'])
|
60
66
|
|
61
67
|
print('extended_entities-----')
|
62
68
|
|
@@ -64,9 +70,7 @@
|
|
64
70
|
|
65
71
|
print('-----')
|
66
72
|
|
67
|
-
for m in tweet['extended_entities']['media']: # こちらは複数要素(画像)がありえる
|
68
|
-
|
69
|
-
|
73
|
+
print(urls)
|
70
74
|
|
71
75
|
|
72
76
|
|