Leser: 3
6 Einträge, 1 Seite |
decode("utf8", $content);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl -l
use strict;
use warnings;
use Encode;
use WWW::Mechanize;
use DBI;
my $user = 'user';
my $passwd = 'passwd';
my $db = 'db';
my $host = 'localhost';
my $driver = "DBI:mysql:$db:$host";
my $dbh = DBI->connect($driver,$user,$passwd) || die $DBI::errstr;
my $mech = new WWW::Mechanize();
$mech->get("http://personalstrategie.de/ab_21_detail.php3?nr=946&kat=ps");
my $statement = "INSERT INTO foo (content, headline) VALUES('".decode("utf8", $mech->content())."', 'foo')";
my $sth = $dbh->prepare($statement) || die $DBI::errstr;
$sth->execute() || die $DBI::errstr;
print "Ready ...";
6 Einträge, 1 Seite |