From: Greg Kroah-Hartman Date: Tue, 5 May 2009 06:03:32 +0000 (-0700) Subject: Merge branch 'master' of git://github.com/amir/bti X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/f3d7e24bd5c7f494515f7a726f852572d2edb400?hp=d78b908e6a18cd5532d9eb3dc1c59f65eaf9b7bc Merge branch 'master' of git://github.com/amir/bti --- diff --git a/bti.c b/bti.c index 0f58d70..69efeb3 100644 --- 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;