release 022
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index 0f58d70..69efeb3 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -174,7 +174,7 @@ static void bti_curl_buffer_free(struct bti_curl_buffer *buffer)
 }
 
 static const char *twitter_host  = "http://twitter.com/statuses";
-static const char *identica_host = "http://identi.ca/api/statuses";
+static const char *identica_host = "https://identi.ca/api/statuses";
 
 static const char *user_uri    = "/user_timeline/";
 static const char *update_uri  = "/update.xml";
@@ -201,11 +201,14 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current)
 {
        xmlChar *text = NULL;
        xmlChar *user = NULL;
+       xmlChar *created = NULL;
        xmlNodePtr userinfo;
 
        current = current->xmlChildrenNode;
        while (current != NULL) {
                if (current->type == XML_ELEMENT_NODE) {
+                       if (!xmlStrcmp(current->name, (const xmlChar *)"created_at"))
+                               created = 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,16 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current)
                                        userinfo = userinfo->next;
                                }
                        }
-                       if (user && text) {
-                               printf("[%s] %s\n", user, text);
+
+                       if (user && text && created) {
+                               printf("[%s] (%.16s) %s\n",
+                                       user, created, text);
                                xmlFree(user);
                                xmlFree(text);
+                               xmlFree(created);
                                user = NULL;
                                text = NULL;
+                               created = NULL;
                        }
                }
                current = current->next;