Hello. How do I get wget to ignore urls containing one of the following
strings? The --help did not reveal a suitable option, surprisingly.
 action=
 printable=
 redirect=
 article=
 returnto=
 title=

I would like to remind about the problems with the existing options:
(1) I downloaded an ftp site with --accept=pdf,PDF but only PDF files
were downloaded.
(2) I downloaded a http site with -X forums,wiki but only one was
excluded.
Therefore, I would like to have an example about how the LIST options
are exactly typed.

The options are good but a more general solution would be to have
a script callback system with access to the wget variables. Example:
 wget --accept-script=wikiurls.script
   <other options> http://nwn2wiki.org/Main_Page.html

"wikiurls.script" could be:
  accept = 1;
  if (string_has(CurrentURL,"action=") == 0) accept = 0;
  if (string_has(CurrentURL,"printable=") == 0) accept = 0;
  if (string_has(CurrentURL,"redirect=") == 0) accept = 0;
  if (string_has(CurrentURL,"article=") == 0) accept = 0;
  if (string_has(CurrentURL,"returnto=") == 0) accept = 0;
  if (string_has(CurrentURL,"title=") == 0) accept = 0;
  if (accept == 0) fprintf(rejectedfp,"%s\n",CurrentURL);
  return accept;

Other script for downloading images could be:
  if (string_has(CurrentURL,"/thumbs/") == 0) {
    newurl = strdup(CurrentURL);
    string_delete(newurl,"thumbs/");
    queue_url(newurl);
  } else if (string_has(CurrentURL,"_small") == 0) {
    newurl = strdup(CurrentURL);
    string_replace(newurl,"_small","_large");
    queue_url(newurl);
  }
  accept = 1;
  return accept;

Perhaps not that easy but the idea is there. Other script types could
be parser scripts, e.g., for additional parsing of OpenWindow('page.html');
and OpenImage('image.jpg'); java calls.

Juhana
-- 
  http://music.columbia.edu/mailman/listinfo/linux-graphics-dev
  for developers of open source graphics software

Reply via email to