diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-25 20:10:23 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-25 20:10:23 +0200 |
commit | ec3972361d95f6f5956df77f7a76105b5ae6af72 (patch) | |
tree | 316396d15290941f20b633fbe4f44d4427af4291 /inc/poche/Poche.class.php | |
parent | fccd59e2e303cdbb45293365bf92921b831bf140 (diff) | |
download | wallabag-ec3972361d95f6f5956df77f7a76105b5ae6af72.tar.gz wallabag-ec3972361d95f6f5956df77f7a76105b5ae6af72.tar.zst wallabag-ec3972361d95f6f5956df77f7a76105b5ae6af72.zip |
poche now uses Full Text RSS to fetch content
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r-- | inc/poche/Poche.class.php | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index cb338766..646193f7 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -156,36 +156,31 @@ class Poche | |||
156 | switch ($action) | 156 | switch ($action) |
157 | { | 157 | { |
158 | case 'add': | 158 | case 'add': |
159 | if($parametres_url = $url->fetchContent()) { | 159 | $content = $url->extract(); |
160 | if ($this->store->add($url->getUrl(), $parametres_url['title'], $parametres_url['content'], $this->user->getId())) { | 160 | |
161 | Tools::logm('add link ' . $url->getUrl()); | 161 | if ($this->store->add($url->getUrl(), $content['title'], $content['body'], $this->user->getId())) { |
162 | $sequence = ''; | 162 | Tools::logm('add link ' . $url->getUrl()); |
163 | if (STORAGE == 'postgres') { | 163 | $sequence = ''; |
164 | $sequence = 'entries_id_seq'; | 164 | if (STORAGE == 'postgres') { |
165 | } | 165 | $sequence = 'entries_id_seq'; |
166 | $last_id = $this->store->getLastId($sequence); | ||
167 | if (DOWNLOAD_PICTURES) { | ||
168 | $content = filtre_picture($parametres_url['content'], $url->getUrl(), $last_id); | ||
169 | Tools::logm('updating content article'); | ||
170 | $this->store->updateContent($last_id, $content, $this->user->getId()); | ||
171 | } | ||
172 | if (!$import) { | ||
173 | $this->messages->add('s', _('the link has been added successfully')); | ||
174 | } | ||
175 | } | 166 | } |
176 | else { | 167 | $last_id = $this->store->getLastId($sequence); |
177 | if (!$import) { | 168 | if (DOWNLOAD_PICTURES) { |
178 | $this->messages->add('e', _('error during insertion : the link wasn\'t added')); | 169 | $content = filtre_picture($parametres_url['body'], $url->getUrl(), $last_id); |
179 | Tools::logm('error during insertion : the link wasn\'t added ' . $url->getUrl()); | 170 | Tools::logm('updating content article'); |
180 | } | 171 | $this->store->updateContent($last_id, $content, $this->user->getId()); |
172 | } | ||
173 | if (!$import) { | ||
174 | $this->messages->add('s', _('the link has been added successfully')); | ||
181 | } | 175 | } |
182 | } | 176 | } |
183 | else { | 177 | else { |
184 | if (!$import) { | 178 | if (!$import) { |
185 | $this->messages->add('e', _('error during fetching content : the link wasn\'t added')); | 179 | $this->messages->add('e', _('error during insertion : the link wasn\'t added')); |
186 | Tools::logm('error during content fetch ' . $url->getUrl()); | 180 | Tools::logm('error during insertion : the link wasn\'t added ' . $url->getUrl()); |
187 | } | 181 | } |
188 | } | 182 | } |
183 | |||
189 | if (!$import) { | 184 | if (!$import) { |
190 | Tools::redirect(); | 185 | Tools::redirect(); |
191 | } | 186 | } |
@@ -220,7 +215,6 @@ class Poche | |||
220 | } | 215 | } |
221 | break; | 216 | break; |
222 | default: | 217 | default: |
223 | Tools::logm('action ' . $action . 'doesn\'t exist'); | ||
224 | break; | 218 | break; |
225 | } | 219 | } |
226 | } | 220 | } |