summaryrefslogtreecommitdiff
path: root/src/timeline_window.c
diff options
context:
space:
mode:
authornirav <nirav@teisuu.com>2019-03-10 23:45:19 +0530
committerDandelion <nirav@teisuu.com>2019-03-11 23:05:22 +0530
commit63e8c7f9d095fe0b1e0b44f950230c0e238f166d (patch)
tree01e0211f4fdede1eccda010fc944b3a0180a9632 /src/timeline_window.c
parent7e8ea36eb8106b4847af13a27a3e8f3177d25809 (diff)
downloadap_client-63e8c7f9d095fe0b1e0b44f950230c0e238f166d.tar.gz
ap_client-63e8c7f9d095fe0b1e0b44f950230c0e238f166d.zip
Add config and log
Diffstat (limited to 'src/timeline_window.c')
-rw-r--r--src/timeline_window.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/timeline_window.c b/src/timeline_window.c
index c09397a..10f2a84 100644
--- a/src/timeline_window.c
+++ b/src/timeline_window.c
@@ -7,13 +7,29 @@
#include "auth.h"
#include "http.h"
#include "timeline.h"
+#include "log.h"
static GtkWidget *window;
static GtkWidget *box;
static GtkWidget *label;
-static void load_tieline()
+static void timeline_callback(bool success, struct timeline *t)
{
+ for (size_t i = 0; i < t->size; i++) {
+ printf("status id: %s\n", t->statuses[i]->id);
+ printf("content: %s\n", t->statuses[i]->content);
+ printf("reblog count: %d\n", t->statuses[i]->reblogs_count);
+ printf("fav count: %d\n", t->statuses[i]->favourites_count);
+ printf("\n");
+ }
+}
+
+static void load_timeline()
+{
+ if (get_timeline(NULL, NULL, NULL, 20, &timeline_callback)) {
+ log_msg(LOG_ERROR, "load_timeline", "failed");
+ return;
+ }
return;
}
@@ -34,5 +50,5 @@ void create_timeline_window(GtkApplication *app, gpointer user_data)
gtk_container_add(GTK_CONTAINER(box), label);
gtk_widget_show_all(window);
- load_tieline();
+ load_timeline();
}