pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/tscrape tscrape: Backport upstream patch to fetch ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8513736ce475
branches:  trunk
changeset: 413967:8513736ce475
user:      leot <leot%pkgsrc.org@localhost>
date:      Mon Mar 23 15:06:08 2020 +0000

description:
tscrape: Backport upstream patch to fetch tweet with multiple js-stream-item

Previously, without that patch, some tweets were accidentally not parsed.

PKGREVISION++

diffstat:

 www/tscrape/Makefile                |   3 ++-
 www/tscrape/patches/patch-tscrape.c |  19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r aa3e356b37f8 -r 8513736ce475 www/tscrape/Makefile
--- a/www/tscrape/Makefile      Mon Mar 23 15:03:14 2020 +0000
+++ b/www/tscrape/Makefile      Mon Mar 23 15:06:08 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2020/02/23 20:39:53 leot Exp $
+# $NetBSD: Makefile,v 1.6 2020/03/23 15:06:08 leot Exp $
 
 DISTNAME=      tscrape-0.4
+PKGREVISION=   1
 CATEGORIES=    www
 MASTER_SITES=  http://codemadness.org/releases/tscrape/
 
diff -r aa3e356b37f8 -r 8513736ce475 www/tscrape/patches/patch-tscrape.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/tscrape/patches/patch-tscrape.c       Mon Mar 23 15:06:08 2020 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-tscrape.c,v 1.1 2020/03/23 15:06:08 leot Exp $
+
+Ignore possible consecutive `js-stream-item' when parsing a single tweet.
+
+Backport from upstream commit:
+
+ 426522824e719e081c9c5e47ba8771779b0fdc85
+
+--- tscrape.c.orig     2020-02-23 19:36:28.000000000 +0000
++++ tscrape.c
+@@ -159,6 +159,8 @@ xmltagstartparsed(XMLParser *x, const ch
+               state = 0;
+       } else if (!strcmp(t, "li") &&
+                  isclassmatch(classname, STRP("js-stream-item"))) {
++              if (state & Item)
++                      return;
+               state |= Item;
+               datatime[0] = text[0] = timestamp[0] = itemfullname[0] = '\0';
+               itemid[0] = itemusername[0] = retweetid[0] = '\0';



Home | Main Index | Thread Index | Old Index