$doc->loadHTML($contentRow->pc_fulltext);
}
- //FIXME: delete old content
+ //delete old content
+ $this->db->exec(
+ 'DELETE FROM rboomarks WHERE'
+ . ' rb_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ );
+ $this->db->exec(
+ 'DELETE FROM rcomments WHERE'
+ . ' rc_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ );
+ $this->db->exec(
+ 'DELETE FROM rlinks WHERE'
+ . ' rl_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ );
$ce = new Content_Extractor_Comment($this->deps->log);
$data = $ce->extract($doc, $contentRow->p_source, $contentRow->p_target);
);
return;
}
- //FIXME: bookmark, link
+
+ //FIXME: bookmark
+
+ $ce = new Content_Extractor_Link($this->deps->log);
+ $data = $ce->extract($doc, $contentRow->p_source, $contentRow->p_target);
+ if ($data !== null) {
+ $this->log->info('Link found');
+ var_dump($data);
+ $this->db->exec(
+ 'INSERT INTO rlinks SET'
+ . ' rl_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ . ', rl_source = ' . $this->db->quote($contentRow->p_source)
+ . ', rl_target = ' . $this->db->quote($contentRow->p_target)
+ . ', rl_title = ' . $this->db->quote($data['title'])
+ . ', rl_author_name = ' . $this->db->quote($data['author_name'])
+ . ', rl_author_url = ' . $this->db->quote($data['author_url'])
+ . ', rl_author_image = ' . $this->db->quote($data['author_image'])
+ . ', rc_updated = NOW()'
+ );
+ return;
+ }
+
+ $this->log->info('Nothing found');
}