aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-03-24 18:38:02 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-03-24 18:38:02 +1300
commit18910c31944122eab846f91779285fd9a2720733 (patch)
tree9234e02c8f66b9e4767ca14374e032f9275b4e96
downloadrssd-18910c31944122eab846f91779285fd9a2720733.tar.gz
rssd-18910c31944122eab846f91779285fd9a2720733.zip
Commit first working version
-rw-r--r--.gitignore1
-rw-r--r--Makefile9
-rw-r--r--README.markdown17
-rw-r--r--rssd.c25
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
+
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 <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);
+}
+