From d5034c7047400defe3404d2d17d39440f76ae8bc Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 25 May 2018 16:23:28 +0200 Subject: [PATCH] print all images in tweet details --- screenless/bureau/publicrelations/publicrelations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 494308a..430a1e2 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -185,8 +185,8 @@ class PublicRelations(Bureau): prn._raw(t_enc) if "media" in tweet["entities"]: - if len(tweet["entities"]["media"]) > 0: - i_url = tweet["entities"]["media"][0]["media_url"] + for entity in tweet["entities"]["media"] + i_url = entity["media_url"] filename = i_url.rsplit('/',1)[1] filename = "/tmp/" + filename print("fetching", i_url, filename)