diff options
author | kdx <kikoodx@paranoici.org> | 2023-01-12 19:06:56 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-01-12 19:06:56 +0100 |
commit | f9ca781f1222c95272b7f380460cf093821b5bee (patch) | |
tree | 8d7ccf1823ab714ecf89b07d8d5d45f1342853be | |
parent | 42e637b9fb461bd1df67032900df7fd6436243cb (diff) | |
download | cite-scrapper-f9ca781f1222c95272b7f380460cf093821b5bee.tar.gz |
ignore french movies
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | cite.c | 8 | ||||
-rwxr-xr-x | scrap.sh | 4 |
3 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,4 @@ seances.xml cite cite.html +citenofr.html @@ -33,8 +33,10 @@ static void print_times(Movie *movie) printf("</ul>\n"); } -static void print_movie(Movie *movie) +static void print_movie(Movie *movie, int hide_fr) { + if (hide_fr && strcmp(movie->nationality, "France") == 0) + return; if (movie->og_title[0] != '\0') printf("<h2>%s</h2>\n", movie->og_title); else @@ -155,7 +157,7 @@ static int append_movie_times(Movie *movie, const xmlNode *node) int main(int argc, char **argv) { - if (argc != 2) + if (argc != 3) return 1; xmlDoc *const document = xmlReadFile(argv[1], NULL, 0); if (document == NULL) { @@ -184,7 +186,7 @@ int main(int argc, char **argv) print_style(); printf("<h1><a href=\"http://www.citebd.org/spip.php?film2912\">cinéma de la cité</a></h1>\n"); for (Movie *movie = movies; movie->id != 0; movie++) - print_movie(movie); + print_movie(movie, atoi(argv[2])); xmlFreeDoc(document); xmlCleanupParser(); return 0; @@ -1,5 +1,7 @@ #!/bin/sh ./build.sh || exit 1 curl -o seances.xml 'http://www.citebd.org/IMG/xml/allocineseances-4.xml' || exit 1 -./cite seances.xml >cite.html || exit 1 +./cite seances.xml 0 >cite.html || exit 1 scp cite.html root@kdx.re:/var/www/html +./cite seances.xml 1 >citenofr.html || exit 1 +scp citenofr.html root@kdx.re:/var/www/html |