diff --git a/misc/ljdc.perl b/misc/ljdc.perl index 9b5c41b..dc5bc83 100755 --- a/misc/ljdc.perl +++ b/misc/ljdc.perl @@ -31,7 +31,6 @@ if( ! open(OUT_FILE,">:encoding(utf-8)", $out_file) ) { } print(OUT_FILE "\n"); -# print(OUT_FILE ''); print(OUT_FILE "\n"); while( defined( $address = ) ) { @@ -58,16 +57,25 @@ while( defined( $address = ) ) { foreach my $line (@lines) { + # Title if (length($title) == 0 && $line =~ /Les joies du code - (.*)<\/title>/) { $title = $1; } - if ($line =~ /<p class="c1"><img.*src=\"([^"]+)\".*\/><\/p>/) { + if (length($title) == 0 && $line =~ /<title>The coding love - (.*)<\/title>/) { + $title = $1; + } + + # IMG + if ($line =~ /<p class="c1">.*<img.*src="([^"]+.gif)".*\/><\/p>/) { $img = $1; last; } - - if ($line =~ /<div class="bodytype"> <p class="centredimg"><img .*src=\"([^"]+)\".*\/>/) { + if ($line =~ /<div class="bodytype"> <p class="centredimg"><img .*src="([^"]+.gif)".*\/>/) { + $img = $1; + last; + } + if ($line =~ /<div class="bodytype"> <p class="e"><img .*src="([^"]+.gif)".*\/>/) { $img = $1; last; }