Ping.fm in Perl

Using the fabulous ping.fm? Want to use your own Custom URL? Want to use Perl? Use this!

The attached script takes only status updates from ping.fm and writes it out to a file. In my case, this file is then "included" by apache dynamically on the front page of my site.

Bit rough and ready, but hey, it only took 60 seconds :)

   1: #!/usr/bin/perl
   2:  
   3: use strict;
   4: use warnings;
   5:  
   6: use CGI qw/:standard/;
   7: use CGI::Carp 'fatalsToBrowser';
   8:  
   9: my $file = '/path/to/my/file.include';
  10:  
  11: open my $FH, '>', $file or die "Unable to open $file\n";
  12:  
  13: if ( param() ) {
  14:  
  15:        print header;
  16:        my $method = param('method');
  17:        my $title = param('title');
  18:        my $message = param('message');
  19:        
  20:        print $FH "$message";
  21:        
  22: }
  23:  
  24: else {
  25:  
  26:     print header;
  27:     #Do nothing
  28:     
  29: }
  30:  
  31: close $FH;