Created
August 18, 2015 15:28
-
-
Save iamleot/020d00b826d948d903a7 to your computer and use it in GitHub Desktop.
Add guid support to rsstail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- r2t.c.orig 2015-08-18 14:09:00.000000000 +0000 | |
+++ r2t.c | |
@@ -139,6 +139,7 @@ void usage(void) | |
printf("-p show publication date\n"); | |
printf("-a show author\n"); | |
printf("-c show comments\n"); | |
+ printf("-g show guid\n"); | |
printf("-N do not show headings\n"); | |
printf("-b x limit description/comments to x bytes\n"); | |
printf("-z continue even if there are XML parser errors in the RSS feed\n"); | |
@@ -169,7 +170,7 @@ int main(int argc, char *argv[]) | |
char *proxy = NULL, *proxy_auth = NULL; | |
int sw = 0; | |
int verbose = 0; | |
- char show_timestamp = 0, show_link = 0, show_description = 0, show_pubdate = 0, show_author = 0, show_comments = 0; | |
+ char show_timestamp = 0, show_link = 0, show_description = 0, show_pubdate = 0, show_author = 0, show_comments = 0, show_guid = 0; | |
char strip_html = 0, no_error_exit = 0; | |
char one_shot = 0; | |
char no_heading = 0; | |
@@ -186,7 +187,7 @@ int main(int argc, char *argv[]) | |
memset(&mot, 0x00, sizeof(mot)); | |
- while((sw = getopt(argc, argv, "A:Z:1b:PHztldrpacu:Ni:n:x:y:vVh")) != -1) | |
+ while((sw = getopt(argc, argv, "A:Z:1b:PHztldrpacgu:Ni:n:x:y:vVh")) != -1) | |
{ | |
switch(sw) | |
{ | |
@@ -295,6 +296,10 @@ int main(int argc, char *argv[]) | |
show_comments = 1; | |
break; | |
+ case 'g': | |
+ show_guid = 1; | |
+ break; | |
+ | |
case 'u': | |
url = (char **)realloc(url, sizeof(char *) * (n_url + 1)); | |
if (!url) | |
@@ -595,6 +600,9 @@ int main(int argc, char *argv[]) | |
free(comments); | |
} | |
} | |
+ | |
+ if (show_guid && item_cur -> guid != NULL) | |
+ printf("%s%s\n", no_heading?" ":"guid: ", item_cur -> guid); | |
} | |
item_cur = item_cur -> next; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment