From 3c074d1195f1e84d03db2f99aa577325abf522c1 Mon Sep 17 00:00:00 2001 From: "J.R. Mauro" Date: Wed, 29 Apr 2009 20:35:19 -0400 Subject: [PATCH] bti: show timestamp in statuses Make parse_statuses() print timestamps Signed-off-by: J.R. Mauro Signed-off-by: Greg Kroah-Hartman --- bti.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bti.c b/bti.c index 749e0a1..b593b99 100644 --- a/bti.c +++ b/bti.c @@ -201,11 +201,14 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current) { xmlChar *text = NULL; xmlChar *user = NULL; + xmlChar *time = NULL; xmlNodePtr userinfo; current = current->xmlChildrenNode; while (current != NULL) { if (current->type == XML_ELEMENT_NODE) { + if (!xmlStrcmp(current->name, (const xmlChar *)"created_at")) + time = xmlNodeListGetString(doc, current->xmlChildrenNode, 1); if (!xmlStrcmp(current->name, (const xmlChar *)"text")) text = xmlNodeListGetString(doc, current->xmlChildrenNode, 1); if (!xmlStrcmp(current->name, (const xmlChar *)"user")) { @@ -219,12 +222,15 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current) userinfo = userinfo->next; } } - if (user && text) { - printf("[%s] %s\n", user, text); + + if (user && text && time) { + printf("[%s] (%.16s) %s\n", user, time, text); xmlFree(user); xmlFree(text); + xmlFree(time); user = NULL; text = NULL; + time = NULL; } } current = current->next; -- 2.39.5