1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00

Oops, forgot to add rss.c file.

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@866 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2007-05-06 12:59:31 +00:00
parent 85fdf4bf7e
commit 904d5c9afa

41
src/rss.c Normal file
View File

@ -0,0 +1,41 @@
/*
* rss.c
* RSS stuff
*
* $Id$
*/
#include <mrss.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
GList*
get_rss_info(char *uri, int count)
{
mrss_t *data;
mrss_item_t *item;
mrss_error_t ret;
GList *titles = NULL;
int i = 0;
ret = mrss_parse_url(uri, &data);
if (ret) {
titles = g_list_append(titles, mrss_strerror(ret));
return titles;
}
for (item = data->item; item; item = item->next) {
char *tmp = strdup(item->title);
titles = g_list_append(titles, tmp);
if ((count > 0) && (++i > count - 1))
goto cleanup;
}
cleanup:
mrss_free(data);
return titles;
}