/* raeddit: a simple reddit client for maemo. compile with: gcc `pkg-config --cflags --libs glib-2.0 hildon-1 json-glib-1.0 libcurl dbus-glib-1` raeddit-01.c greddit.c -o raeddit-01 */ #include <gtk/gtk.h> #include <curl/curl.h> #include <stdlib.h> #include <stdio.h> #include "greddit.h" int main(int argc, char **argv) { GSList *posts = NULL; GSList *cursor; g_type_init (); curl_global_init (CURL_GLOBAL_ALL); posts = greddit_get_posts (); for (cursor=posts; cursor; cursor = cursor->next) { GRedditPost *post = (GRedditPost*) cursor->data; printf ("%s\n(%d) %s\nposted by %s to %s\n\n", post->url, post->score, post->title, post->author, post->subreddit); } if (!posts) { printf ("Nothing found.\n"); return EXIT_FAILURE; } greddit_free_posts (posts); curl_global_cleanup (); return EXIT_SUCCESS; }
gcc `pkg-config --cflags --libs glib-2.0 hildon-1 json-glib-1.0 libcurl dbus-glib-1` raeddit-01.c greddit.c -o raeddit-01