preferred_view #4

  • //
  • guest/
  • barrie_slaymaker/
  • safari/
  • src/
  • conf/
  • bin/
  • preferred_view
  • View
  • Commits
  • Open Download .zip Download (801 B)
#!/usr/bin/perl -w

#
# preferred_view for Safari
# Copyright (c) 1999 by Barrie Slaymaker, rbs@telerama.com
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the README file.
#

use strict ;

die "Need a single argument which is a file name" unless @ARGV == 1 ;

use File::Type qw( get_type type_2_mime type_2_file_output ) ;

my $file_type   = get_type( { follow => 1 }, $ARGV[0] ) ;
my $file_output = type_2_file_output( $file_type ) ;
my $mime_type   = type_2_mime( $file_type ) ;

print STDERR join( ' ', $file_type, $mime_type, $file_output ), "\n" ;

if ( defined( $mime_type ) && $mime_type eq 'text/html' ) {
   print STDERR "html\n" ;
   print "None\n"
}
else {
   print STDERR "plain\n" ;
   print "plain\n" ;
}

0 ;
# Change User Description Committed
#4 195 Barrie Slaymaker Added filters NoMunes, None (replaces HTML), tool Download.
#3 168 Barrie Slaymaker Added YAPC paper, slides
#2 165 Barrie Slaymaker Applied Greg KH's license patch.
#1 162 Barrie Slaymaker First code & documentation checkin