fix data-image-url - tscrape - twitter scraper
(HTM) git clone git://git.codemadness.org/tscrape
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 30a8b7252f74e21ba76ca08d00ffc294abad302f
(DIR) parent 74421a0dd39d2f3cd496ab9e9efcf38e2fef594e
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 25 Aug 2017 16:37:55 +0200
fix data-image-url
Diffstat:
M tscrape.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/tscrape.c b/tscrape.c
@@ -177,7 +177,9 @@ xmlattr(XMLParser *x, const char *t, size_t tl, const char *a, size_t al,
} else if (!strcmp(t, "span") && !strcmp(a, "data-time")) {
/* UNIX timestamp */
strlcpy(datatime, v, sizeof(datatime));
- } else if (!strcmp(a, "data-image-url")) {
+ }
+ /* NOTE: can be <div data-image-url>. */
+ if (!strcmp(a, "data-image-url")) {
strlcat(text, " ", sizeof(text));
strlcat(text, v, sizeof(text));
}