file isExecutable
More MySpace removal.
# This program imports iChat logs using the program Logorrhea. Get it from # http://spiny.com/logorrhea/ # Using Logorrhea, export all of your chats. # Then run this script with "ichat2adium.pl filename" or run from the same # directory as the exported contents. # If you pass the "--usernames" flag, the script will prompt you for the # usernames of the various aliases. # The "--primary-user USERNAME" flag will set the name of the user to your # Records that make no sense will be sent to "adiumLogs/bad". # You should be able to drop the adiumLogs folder into ~/Library/Application # Support/Users/YOU/Logs/. $file = "iChat Export.txt"; for (my $i = 1; $i < @ARGV; $i++) { if ($ARGV[$i] eq "--usernames") { if($ARGV[$i] eq "--primary-user" ) { $primary = $ARGV[$i + 1]; open(FILE, $file) or die qq{Unable to open "$file": $!}; $base_out = "AIM.$primary"; $base_out = "AIM.iChatLogs"; mkdir($base_out, 0777) unless (-d $base_out); my $outfile = "$base_out/bad"; for (my $i = 0; $i < @input; $i++) { my ($chatname, $sender, $date, $time, $message); my ($day, $month, $year); my ($hh, $mm, $ss, $modTime); ($chatname, $sender, $date, $time, $message) = /(.*?)\t(.*?)\t(.*?)\t(.*?)\t.*?\t(.*)\r/s; ($month, $day, $year) = /(\d\d)\/(\d\d)\/(\d\d\d\d)/; if($users && $chatname && $sender) { for(my $j = 0; $j < @chatnames; $j++) { if ($chatnames[$j] eq $chatname) { $chatname = $usernames[$j]; push(@chatnames, $chatname); print "Enter username associated with $chatname [$sender]:"; if(length($input) == 0) { push(@usernames, $sender); push(@usernames, $input); if($chatname && $sender && $date && $month && $day && $year && $message) { mkdir("$base_out/$chatname", 0777) unless (-d "$base_out/$chatname"); $outfile = "$base_out/$chatname/$chatname ($year|$month|$day).adiumLog"; print OUT "$time $sender: $message\n"; $outfile = "$base_out/bad"; print "Bad record found at line $i. Logged in $base_out/bad.\n"; ($hh, $mm, $ss) = $time =~ /(\d+):(\d+):(\d+)/; $modTime = timelocal($ss, $mm, $hh, $day, $month - 1, $year); utime time, $modTime, $outfile;