1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-27 17:28:39 +00:00

Fixed #54 - récupération de l'id améliorée et utilisation de action_to_do() pour l'insertion dans l'import pocket

This commit is contained in:
nicosomb 2013-04-18 10:15:46 +02:00
parent 64458521c3
commit d06f30ef93
3 changed files with 20 additions and 33 deletions

View file

@ -29,26 +29,8 @@ else {
$a = $li->find('a');
$url = $a[0]->href;
# FIXME corriger cette génération d'ID
$req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC");
$id = $req->fetchColumn()+1;
$parametres_url = prepare_url($url, $id);
$sql_action = 'INSERT INTO entries ( url, title, content, is_read ) VALUES (?, ?, ?, ?)';
$params_action = array($url, $parametres_url['title'], $parametres_url['content'], $read);
try
{
# action query
if (isset($sql_action))
{
$query = $db->getHandle()->prepare($sql_action);
$query->execute($params_action);
}
}
catch (Exception $e)
{
logm('error during pocket import : ' . $e->getMessage());
}
action_to_do('add', $url, $token);
}
# Pocket génère un fichier HTML avec deux <ul>
# Le premier concerne les éléments non lus