diff options
Diffstat (limited to 'src/timeline_window.c')
-rw-r--r-- | src/timeline_window.c | 20 |
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(); } |