]> ToastFreeware Gitweb - gregoa/bti.git/blobdiff - bti.c
bti: show timestamp in statuses
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index 749e0a1c23cc265659e61c8d5b3fa63eb5764824..b593b992ce5346fce29915494ff146f35750986b 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 *text = NULL;
        xmlChar *user = NULL;
+       xmlChar *time = NULL;
        xmlNodePtr userinfo;
 
        current = current->xmlChildrenNode;
        while (current != NULL) {
                if (current->type == XML_ELEMENT_NODE) {
        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")) {
                        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;
                                }
                        }
                                        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(user);
                                xmlFree(text);
+                               xmlFree(time);
                                user = NULL;
                                text = NULL;
                                user = NULL;
                                text = NULL;
+                               time = NULL;
                        }
                }
                current = current->next;
                        }
                }
                current = current->next;