7,8d6 < use Spreadsheet::WriteExcel; < use Data::Dumper qw(Dumper); 31d28 < $blogp =~ s/%2C/,/ig; 64d60 < $oneletter = " "; 98d93 < print "

Hello $first_name $last_name
 Local:
Server: $dmy $hms $dttz

"; 100,120c95 < if ($blogp == "") { < $blogp = $first_name; < $oneletter = substr( $blogp, 0, 1 ); < } < < if ($blogp != "") { < $oneletter = substr( $blogp, 0, 1 ); < < if ((ord($oneletter) >= ord("0") && ord($oneletter) <= ord("9")) || ord($oneletter) == 40 ){ < my ($oneurl) = split /,/, $blogp; < < if ($oneurl == $blogp) { < $oneletter = substr( $blogp, 0, 1 ); < } else { < if (ord($oneletter) >= ord("0") && ord($oneletter) <= ord("9")) { < $oneletter = "1"; < $blogp = "( $blogp )"; < } else { < $oneletter = "2"; < } < } --- > if ($blogp == "") { $blogp = $first_name; } else { $oneletter = substr( $blogp, 0, 1 ); } 122,124d96 < } < } < 142,210c114,120 < my ($oneaurl) = split /,/, $blogp; < if (index($blogp, ',') <= 0) { < $sth = $dbh->prepare("SELECT post_title, post_content, ID FROM $tname WHERE ID=?"); < } else { < if (ord($oneletter) != 40) { < $blogp = "($blogp)"; < $sth = $dbh->prepare("SELECT post_title, post_content, ID FROM $tname WHERE ID in $blogp"); < $blogp = ""; < } else { < $sth = $dbh->prepare("SELECT post_title, post_content, ID FROM $tname WHERE ID in $blogp"); < $blogp = ""; < } < } < < if ($blogp == "") { < $sth->execute(); < } else { < $sth->execute( $blogp ); < } < < $exc = 0; < $coln = "A"; < $rown = 6; < $alinkis = ""; < my $workbook = 0; # Spreadsheet::WriteExcel->new('../perl.xls'); < < while (($tt, $cont, $iid) = $sth->fetchrow_array()) { < my ($junk, $imageu) = split / src="/, $cont; < my ($imageurl) = split /"/, $imageu; < my ($junk, $cutto) = split / href="/, $cont; < my ($cuttothechase) = split /"/, $cutto; < if ($exc == 0) { < $exc = 1; < # Create a new Excel workbook < $workbook = Spreadsheet::WriteExcel->new('../perl.xls'); < < # Add a worksheet < $worksheet = $workbook->add_worksheet(); < < # Add and define a format < $format = $workbook->add_format(); # Add a format < $format->set_bold(); < $format->set_color('red'); < $format->set_align('center'); < < # Write a formatted and unformatted string, row and column notation. < $col = $row = 0; < $worksheet->write($row, $col, "$first_name $last_name", $format); < # $worksheet->write(1, $col, 'Hi Excel!'); < < # Write a number and a formula using A1 notation < $worksheet->write("${coln}3", "$tt"); < $worksheet->write("${coln}4", "https://www.rjmprogramming.com.au/ITblog/?p=$iid"); < $worksheet->write("${coln}5", "$cuttothechase"); < $worksheet->write("${coln}6", "$imageurl"); < $alinkis = "📄  🏃  🖼"; < print "

$tt  $alinkis

$cont
\n"; < } else { < $rown += 1; < $worksheet->write("${coln}${rown}", "$tt"); < $rown += 1; < $worksheet->write("${coln}${rown}", "https://www.rjmprogramming.com.au/ITblog/?p=$iid"); < $rown += 1; < $worksheet->write("${coln}${rown}", "$cuttothechase"); < $rown += 1; < $worksheet->write("${coln}${rown}", "$imageurl"); < $alinkis = "📄  🏃  🖼"; < print "

$tt  $alinkis

$cont
\n"; < } --- > $sth = $dbh->prepare("SELECT post_title, post_content FROM $tname WHERE ID=?"); > > $sth->execute( $blogp ); > > #while ( @row = $sth->fetchrow_array ) { > while (($tt, $cont) = $sth->fetchrow_array()) { > print "

$tt

$cont
\n";