diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-24 18:38:02 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-24 18:38:02 +1300 |
commit | 18910c31944122eab846f91779285fd9a2720733 (patch) | |
tree | 9234e02c8f66b9e4767ca14374e032f9275b4e96 | |
download | rssd-18910c31944122eab846f91779285fd9a2720733.tar.gz rssd-18910c31944122eab846f91779285fd9a2720733.zip |
Commit first working version
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | README.markdown | 17 | ||||
-rw-r--r-- | rssd.c | 25 |
4 files changed, 52 insertions, 0 deletions
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 + @@ -0,0 +1,25 @@ +#include <mrss.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#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); +} + |