From: J.R. Mauro Date: Thu, 30 Apr 2009 00:35:19 +0000 (-0400) Subject: bti: show timestamp in statuses X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/3c074d1195f1e84d03db2f99aa577325abf522c1?hp=42c3abaf512a54fddb6cd95eb142d2319ba650cf bti: show timestamp in statuses Make parse_statuses() print timestamps Signed-off-by: J.R. Mauro Signed-off-by: Greg Kroah-Hartman --- 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;