/usr/share/doc/libmrss0-dev/examples/search.c is in libmrss0-dev 0.19.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include <stdio.h>
#include <string.h>
#include "mrss.h"
int
main (int argc, char **argv)
{
mrss_t *data;
mrss_error_t ret;
mrss_item_t *item;
mrss_tag_t *tag;
CURLcode code;
if (argc != 2)
{
fprintf (stderr,
"Usage:\n\t%s url_rss\n\nExample:\n\t%s http://ngvision.org/rss|file.rss\n\n",
argv[0], argv[0]);
return 1;
}
if (!strncmp (argv[1], "http://", 7) || !strncmp (argv[1], "https://", 8))
ret = mrss_parse_url_with_options_and_error (argv[1], &data, NULL, &code);
else
ret = mrss_parse_file (argv[1], &data);
if (ret)
{
fprintf (stderr, "MRSS return error: %s\n",
ret ==
MRSS_ERR_DOWNLOAD ? mrss_curl_strerror (code) :
mrss_strerror (ret));
return 1;
}
for (item = data->item; item; item = item->next)
{
fprintf (stdout, "Item -%s-: ", item->link);
if (mrss_search_tag
(item, "encoded", "http://purl.org/rss/1.0/modules/content/",
&tag) != MRSS_OK || !tag)
{
fprintf (stdout, " no Encoded tag\n");
}
else
fprintf (stdout, " encoded %s\n", tag->value);
}
mrss_free (data);
return 0;
}
|