Update ljdc.perl
This commit is contained in:
parent
951dcc47f7
commit
c53f48846d
|
@ -31,7 +31,6 @@ if( ! open(OUT_FILE,">:encoding(utf-8)", $out_file) ) {
|
|||
}
|
||||
|
||||
print(OUT_FILE "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
# print(OUT_FILE '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
|
||||
print(OUT_FILE "<ljdc>\n");
|
||||
|
||||
while( defined( $address = <IN_FILE> ) ) {
|
||||
|
@ -58,16 +57,25 @@ while( defined( $address = <IN_FILE> ) ) {
|
|||
|
||||
foreach my $line (@lines) {
|
||||
|
||||
# Title
|
||||
if (length($title) == 0 && $line =~ /<title>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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user