|
@@ -81,6 +81,7 @@ function extract_comments_from_html(string $html): array {
|
|
|
);
|
|
|
$meta['text'] = pup_selector($comment, 'tr:nth-child(3) td.testoFTR text{}');
|
|
|
$meta['html'] = pup_selector($comment, 'tr:nth-child(3) td.testoFTR');
|
|
|
+ $meta['title'] = pup_selector($comment, 'tr:first-child td.titoloFTR:nth-child(2) text{}');
|
|
|
|
|
|
if($date !== false) {
|
|
|
$meta['published'] = strftime('%s', $date);
|
|
@@ -161,7 +162,7 @@ function save($db, $metadata) {
|
|
|
foreach($metadata['comments'] as $comm)
|
|
|
{
|
|
|
$i++;
|
|
|
- $stm = $db->prepare('INSERT OR REPLACE INTO comments(nid, num, published, author, body) VALUES (?,?,?,?,?)');
|
|
|
+ $stm = $db->prepare('INSERT OR REPLACE INTO comments(nid, num, published, author, title, body) VALUES (?,?,?,?,?,?)');
|
|
|
if($stm === false) {
|
|
|
print("error during INSERT: ");
|
|
|
print($db->errorInfo()[2]);
|
|
@@ -170,9 +171,9 @@ function save($db, $metadata) {
|
|
|
$stm->bindParam(1, $metadata['nid']);
|
|
|
$stm->bindParam(2, $i);
|
|
|
$stm->bindParam(3, $comm['published']);
|
|
|
- //$stm->bindParam(3, $comm['title']);
|
|
|
$stm->bindParam(4, $comm['author']);
|
|
|
- $stm->bindParam(5, $comm['html']);
|
|
|
+ $stm->bindParam(5, $comm['title']);
|
|
|
+ $stm->bindParam(6, $comm['html']);
|
|
|
$stm->execute();
|
|
|
}
|
|
|
}
|