syncrss.pl 388 B

1234567891011121314151617181920212223
  1. #!/usr/bin/perl
  2. my $home = shift;
  3. $home or die "Usage: $0 <dir>\n";
  4. chdir($home);
  5. my $hash = {
  6. 'freeswitch.rss' => 'http://www.freeswitch.org/xml.php'
  7. };
  8. foreach (keys %{$hash}) {
  9. my ($dl) = $hash->{$_} =~ /\/([^\/]+)$/;
  10. my $cmd = "rm -f $_ $dl ; wget $hash->{$_}";
  11. if ($dl ne $_) {
  12. $cmd .= "; /bin/mv $dl $_";
  13. }
  14. $cmd .= "\n";
  15. print $cmd;
  16. system($cmd);
  17. }