From 3cd9e2e98ea314878f34dbd77d5e4429cd8fb44a Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Sat, 6 Jun 2020 01:40:36 +0200 Subject: [PATCH 2/4] Use extended_entities instead of entities Possible medias could be omitted in entities but present in extended_entities. --- tscrape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tscrape.c b/tscrape.c index 4cd45aa..8b211cb 100644 --- a/tscrape.c +++ b/tscrape.c @@ -374,7 +374,7 @@ processnodes(struct json_node *nodes, size_t depth, const char *str) } } - /* [].entities.media[].url */ + /* [].extended_entities.media[].url */ if (depth == 6 && nodes[0].type == JSON_TYPE_ARRAY && nodes[1].type == JSON_TYPE_OBJECT && @@ -382,7 +382,7 @@ processnodes(struct json_node *nodes, size_t depth, const char *str) nodes[3].type == JSON_TYPE_ARRAY && nodes[4].type == JSON_TYPE_OBJECT && nodes[5].type == JSON_TYPE_STRING && - !strcmp(nodes[2].name, "entities") && + !strcmp(nodes[2].name, "extended_entities") && !strcmp(nodes[3].name, "media")) { if (!strcmp(nodes[5].name, "url")) { // printf("DEBUG: url: %s\n", str); -- 2.24.1