bti: show timestamp in statuses
authorJ.R. Mauro <jrm8005@gmail.com>
Thu, 30 Apr 2009 00:35:19 +0000 (20:35 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 May 2009 05:47:08 +0000 (22:47 -0700)
Make parse_statuses() print timestamps

Signed-off-by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bti.c

diff --git a/bti.c b/bti.c
index 749e0a1..b593b99 100644 (file)
--- 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;