tscrape: remove debugging comments - tscrape - twitter scraper
(HTM) git clone git://git.codemadness.org/tscrape
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit cdfc383b166a112646ab21596442d8fb976bc311
(DIR) parent acef6f3969b21a48512c389febf2e6ca9089ebfc
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 1 Oct 2020 20:22:18 +0200
tscrape: remove debugging comments
Diffstat:
M tscrape.c | 19 -------------------
1 file changed, 0 insertions(+), 19 deletions(-)
---
(DIR) diff --git a/tscrape.c b/tscrape.c
@@ -296,11 +296,9 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
nodes[3].type == JSON_TYPE_STRING &&
!strcmp(nodes[2].name, "retweeted_status")) {
if (!strcmp(nodes[3].name, "id_str")) {
-// printf("DEBUG: retweet: id: %s\n", str);
strlcpy(tc->retweetid, str, sizeof(tc->retweetid));
} else if (!strcmp(nodes[3].name, "full_text")) {
strlcpy(tc->full_text, str, sizeof(tc->full_text));
-// printf("DEBUG: retweet: full_text: %s\n", str);
}
}
@@ -314,10 +312,8 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[3].name, "user")) {
if (!strcmp(nodes[4].name, "name")) {
strlcpy(tc->itemfullname, str, sizeof(tc->itemfullname));
-// printf("DEBUG: retweeted_status.user.name: %s\n", str);
} else if (!strcmp(nodes[4].name, "screen_name")) {
strlcpy(tc->itemusername, str, sizeof(tc->itemusername));
-// printf("DEBUG: retweeted_status.user.screen_name: %s\n", str);
}
}
}
@@ -331,8 +327,6 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[3].name, "pinned_tweet_ids")) {
if (nodes[4].type == JSON_TYPE_NUMBER) {
addpinned(str);
-// printf("DEBUG: pinned_tweets_ids[%zu]: %s\n",
-// nodes[4].index, str);
}
}
}
@@ -347,10 +341,8 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[2].name, "entities") &&
!strcmp(nodes[3].name, "urls")) {
if (!strcmp(nodes[5].name, "url")) {
-// printf("DEBUG: url: %s\n", str);
strlcpy(url, str, sizeof(url));
} else if (!strcmp(nodes[5].name, "expanded_url")) {
-// printf("DEBUG: expanded_url: %s\n", str);
/* assumes "expanded_url" is specified after "url" */
addreplacement(url, str);
url[0] = '\0';
@@ -368,16 +360,12 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[2].name, "extended_entities") &&
!strcmp(nodes[3].name, "media")) {
if (!strcmp(nodes[5].name, "media_url_https")) {
-// printf("DEBUG: media_url_https: %s\n", str);
strlcpy(media_url, str, sizeof(media_url));
} else if (!strcmp(nodes[5].name, "url")) {
-// printf("DEBUG: url: %s\n", str);
strlcpy(url, str, sizeof(url));
} else if (!strcmp(nodes[5].name, "expanded_url")) {
-// printf("DEBUG: expanded_url: %s\n", str);
strlcpy(expanded_url, str, sizeof(expanded_url));
} else if (!strcmp(nodes[5].name, "type")) {
-// printf("DEBUG: type: %s\n", str);
if (!strcmp(str, "photo")) {
addreplacement(url, media_url);
} else {
@@ -399,10 +387,8 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[3].name, "entities") &&
!strcmp(nodes[4].name, "urls")) {
if (!strcmp(nodes[6].name, "url")) {
-// printf("DEBUG: url: %s\n", str);
strlcpy(url, str, sizeof(url));
} else if (!strcmp(nodes[6].name, "expanded_url")) {
-// printf("DEBUG: expanded_url: %s\n", str);
addreplacement(url, str);
url[0] = '\0';
}
@@ -421,16 +407,12 @@ processnodes(struct json_node *nodes, size_t depth, const char *str)
!strcmp(nodes[3].name, "extended_entities") &&
!strcmp(nodes[4].name, "media")) {
if (!strcmp(nodes[6].name, "media_url_https")) {
-// printf("DEBUG: media_url_https: %s\n", str);
strlcpy(media_url, str, sizeof(media_url));
} else if (!strcmp(nodes[6].name, "url")) {
-// printf("DEBUG: url: %s\n", str);
strlcpy(url, str, sizeof(url));
} else if (!strcmp(nodes[6].name, "expanded_url")) {
-// printf("DEBUG: expanded_url: %s\n", str);
strlcpy(expanded_url, str, sizeof(expanded_url));
} else if (!strcmp(nodes[6].name, "type")) {
-// printf("DEBUG: type: %s\n", str);
if (!strcmp(str, "photo")) {
addreplacement(url, media_url);
} else {
@@ -462,7 +444,6 @@ main(void)
/* check for pinned tweets */
for (i = 0; i < npinned; i++) {
if (!strcmp(t->itemid, pinnedids[i])) {
-// printf("DEBUG: pinned: %s\n", pinnedids[i]);
t->ispinned = 1;
break;
}