• About Me
  • My Slides

WindyGallery's Weblog

~ I am a normal man in quite imperfect little World.

WindyGallery's Weblog

Monthly Archives: August 2010

:P

26 Thursday Aug 2010

Posted by windygallery in Photos

≈ 1 Comment












Perl Scan Folder and Access Image on Web

26 Thursday Aug 2010

Posted by windygallery in Developer

≈ Leave a comment

Tags

folder, hotlink, images, perl, scan

#!/usr/bin/perl
use LWP::Simple;
use LWP;

# scan all files in folder
sub scanFolder {
   my $dirtoget    = ".\\yourPath\\";
   opendir(IMD, $dirtoget) || die ("Cannot open directory");
   my @thefiles    = readdir(IMD);
   foreach $f (@thefiles)    {
      unless (($f eq ".") || ($f eq "..") )
      {
         my $filename = $dirtoget.$f;
         // do what you want ^^
      }
   }
   closedir(IMD);
}

sub saveImagesFromWWW    {
   my ($filename, $target) = @_;
   my $browser = LWP::UserAgent->new;

   # Get image from hotlink protection
   my $response = $browser->get(
         $filename, # image path
         'Referer' =>   # The URL where I see the strip:
         "http://yourWantedPage.......html",
      );
   $fileOutput = ".\\outputPath\\".$target.".jpg";
   open(OUT, ">".$fileOutput) || die $!;
   binmode(OUT);
   print OUT $response->content;
   close(OUT);
}

Perl Plays Sound

26 Thursday Aug 2010

Posted by windygallery in Developer

≈ Leave a comment

Tags

perl, play, sound

#!/usr/bin/perl
use Win32::Sound;

Win32::Sound::Volume(‘100%’);
Win32::Sound::Play(“delightMind.wav“);
Win32::Sound::Stop();

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • August 2017
  • November 2015
  • August 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • May 2012
  • February 2011
  • January 2011
  • August 2010
  • June 2010
  • May 2010
  • April 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • April 2009
  • March 2009
  • November 2008
  • October 2008

Categories

  • Developer
  • Events
  • Games
  • IDeas
  • Love
  • Photos

Meta

  • Register
  • Log in

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • WindyGallery's Weblog
    • Already have a WordPress.com account? Log in now.
    • WindyGallery's Weblog
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar