From 18910c31944122eab846f91779285fd9a2720733 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 24 Mar 2016 18:38:02 +1300 Subject: Commit first working version --- .gitignore | 1 + Makefile | 9 +++++++++ README.markdown | 17 +++++++++++++++++ rssd.c | 25 +++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.markdown create mode 100644 rssd.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6bfd658 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +rssd diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7652fd3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: all + +LDFLAGS = -lmrss + +all : rssd + +clean : + rm -f rssd + diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..2712fb0 --- /dev/null +++ b/README.markdown @@ -0,0 +1,17 @@ +rssd +==== + +All this does is attempt to retrieve all your feeds and print their titles and +descriptions at the moment. But it works! + + $ sudo apt-get install mrss0 mrss0-dev + $ make + $ ./rssd < ~/.config/newsbeuter/urls + +Author +: Tom Ryder +Copyright +: 2016 +License +: BSD + diff --git a/rssd.c b/rssd.c new file mode 100644 index 0000000..b71e87a --- /dev/null +++ b/rssd.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include + +#define MAX_URL_LENGTH 2048 + +int main(void) +{ + mrss_t *feed = malloc(sizeof(mrss_t)); + mrss_error_t err = 0; + char url[MAX_URL_LENGTH] = ""; + + while (fgets(url, MAX_URL_LENGTH, stdin) != NULL) { + url[strcspn(url, "\n")] = 0; + fprintf(stderr, "Processing URL: %s\n", url); + err = mrss_parse_url(url, &feed); + fprintf(stderr, "Error value: %u\n", err); + fprintf(stderr, "Feed title: %s\n", feed->title); + fprintf(stderr, "Feed description: %s\n", feed->description); + } + + exit(EXIT_SUCCESS); +} + -- cgit v1.2.3