aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2019-11-07 12:17:01 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-11-15 16:08:36 +0100
commit958e77e6a7c779de11f0f070b70c861c246a959f (patch)
tree02717c536865a32983017faf5ec195f0e7148fc9
parent3c5aa05311d057c8fed83f085e6fb6ecc874fca4 (diff)
downloadwallabag-958e77e6a7c779de11f0f070b70c861c246a959f.tar.gz
wallabag-958e77e6a7c779de11f0f070b70c861c246a959f.tar.zst
wallabag-958e77e6a7c779de11f0f070b70c861c246a959f.zip
Added elCurator import
-rw-r--r--app/config/config.yml14
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.th.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml3
-rw-r--r--src/Wallabag/ImportBundle/Controller/ElcuratorController.php41
-rw-r--r--src/Wallabag/ImportBundle/Import/ElcuratorImport.php54
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/rabbit.yml8
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/redis.yml21
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/services.yml12
-rw-r--r--src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig3
-rw-r--r--tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php132
-rw-r--r--tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php2
-rw-r--r--tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php1
-rw-r--r--tests/Wallabag/ImportBundle/fixtures/elcurator.json13
25 files changed, 342 insertions, 1 deletions
diff --git a/app/config/config.yml b/app/config/config.yml
index 642e198d..0b325afe 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -261,6 +261,11 @@ old_sound_rabbit_mq:
261 exchange_options: 261 exchange_options:
262 name: 'wallabag.import.wallabag_v2' 262 name: 'wallabag.import.wallabag_v2'
263 type: topic 263 type: topic
264 import_elcurator:
265 connection: default
266 exchange_options:
267 name: 'wallabag.import.elcurator'
268 type: topic
264 import_firefox: 269 import_firefox:
265 connection: default 270 connection: default
266 exchange_options: 271 exchange_options:
@@ -326,6 +331,15 @@ old_sound_rabbit_mq:
326 name: 'wallabag.import.wallabag_v2' 331 name: 'wallabag.import.wallabag_v2'
327 callback: wallabag_import.consumer.amqp.wallabag_v2 332 callback: wallabag_import.consumer.amqp.wallabag_v2
328 qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} 333 qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
334 import_elcurator:
335 connection: default
336 exchange_options:
337 name: 'wallabag.import.elcurator'
338 type: topic
339 queue_options:
340 name: 'wallabag.import.elcurator'
341 callback: wallabag_import.consumer.amqp.elcurator
342 qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
329 import_firefox: 343 import_firefox:
330 connection: default 344 connection: default
331 exchange_options: 345 exchange_options:
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 6f381408..8573ba72 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -465,6 +465,9 @@ import:
465 # wallabag_v2: 465 # wallabag_v2:
466 # page_title: 'Import > Wallabag v2' 466 # page_title: 'Import > Wallabag v2'
467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' 467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 # readability: 471 # readability:
469 # page_title: 'Import > Readability' 472 # page_title: 'Import > Readability'
470 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 473 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index 7efb18aa..50e67d47 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Aus wallabag v2 importieren' 466 page_title: 'Aus wallabag v2 importieren'
467 description: 'Dieser Import wird all deine Artikel aus wallabag v2 importieren. Gehe auf "Alle Artikel" und dann, in der Exportieren-Seitenleiste auf "JSON". Dabei erhältst du eine "All articles.json"-Datei.' 467 description: 'Dieser Import wird all deine Artikel aus wallabag v2 importieren. Gehe auf "Alle Artikel" und dann, in der Exportieren-Seitenleiste auf "JSON". Dabei erhältst du eine "All articles.json"-Datei.'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Aus Readability importieren' 472 page_title: 'Aus Readability importieren'
470 description: 'Dieser Import wird all deine Artikel aus Readability importieren. Auf der Tools Seite (https://www.readability.com/tools/) klickst du auf "Exportiere deine Daten" in dem Abschnitt "Datenexport". Du wirst eine E-Mail mit einem Downloadlink zu einer json Datei, die aber nicht auf .json endet, erhalten' 473 description: 'Dieser Import wird all deine Artikel aus Readability importieren. Auf der Tools Seite (https://www.readability.com/tools/) klickst du auf "Exportiere deine Daten" in dem Abschnitt "Datenexport". Du wirst eine E-Mail mit einem Downloadlink zu einer json Datei, die aber nicht auf .json endet, erhalten'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index cf98e408..206d3562 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Import > Wallabag v2' 466 page_title: 'Import > Wallabag v2'
467 description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' 467 description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.'
468 elcurator:
469 page_title: 'Import > elCurator'
470 description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Import > Readability' 472 page_title: 'Import > Readability'
470 description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 473 description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index b7cdd261..10f5e79a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Importar > Wallabag v2' 466 page_title: 'Importar > Wallabag v2'
467 description: 'Importa todos tus artículos de wallabag v2. En la sección Todos los artículos, en la barra lateral, haga clic en "JSON". Obtendrás un archivo llamado "All articles.json".' 467 description: 'Importa todos tus artículos de wallabag v2. En la sección Todos los artículos, en la barra lateral, haga clic en "JSON". Obtendrás un archivo llamado "All articles.json".'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Importar > Readability' 472 page_title: 'Importar > Readability'
470 description: 'Importa todos tus artículos de Readability. En la página de herramientas (https://www.readability.com/tools/), haga clic en "Exportar tus datos" en la sección "Exportar datos". Recibirás un correo electrónico para descargar un JSON (que no tiene extensión .json).' 473 description: 'Importa todos tus artículos de Readability. En la página de herramientas (https://www.readability.com/tools/), haga clic en "Exportar tus datos" en la sección "Exportar datos". Recibirás un correo electrónico para descargar un JSON (que no tiene extensión .json).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 66e83e16..730b7e68 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'درون‌ریزی > Wallabag v2' 466 page_title: 'درون‌ریزی > Wallabag v2'
467 description: 'این برنامه همهٔ داده‌های شما را در نسخهٔ ۲ wallabag درون‌ریزی می‌کند. به بخش «همهٔ مقاله‌ها» بروید و در بخش «برون‌ریزی» روی "JSON" کلیک کنید. با این کار شما پرونده‌ای به شکل "All articles.json" دریافت خواهید کرد.' 467 description: 'این برنامه همهٔ داده‌های شما را در نسخهٔ ۲ wallabag درون‌ریزی می‌کند. به بخش «همهٔ مقاله‌ها» بروید و در بخش «برون‌ریزی» روی "JSON" کلیک کنید. با این کار شما پرونده‌ای به شکل "All articles.json" دریافت خواهید کرد.'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'درون‌ریزی > Readability' 472 page_title: 'درون‌ریزی > Readability'
470 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 473 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 6fb856f2..1eecd111 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: "Importer > wallabag v2" 466 page_title: "Importer > wallabag v2"
467 description: "Cet outil va importer tous vos articles d’une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur « JSON ». Vous allez récupérer un fichier « All articles.json »" 467 description: "Cet outil va importer tous vos articles d’une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur « JSON ». Vous allez récupérer un fichier « All articles.json »"
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: "Importer > Readability" 472 page_title: "Importer > Readability"
470 description: "Cet outil va importer toutes vos données de Readability. Sur la page des outils (https://www.readability.com/tools/), cliquez sur « Export your data » dans la section « Data Export ». Vous allez recevoir un courriel avec un lien pour télécharger le json." 473 description: "Cet outil va importer toutes vos données de Readability. Sur la page des outils (https://www.readability.com/tools/), cliquez sur « Export your data » dans la section « Data Export ». Vous allez recevoir un courriel avec un lien pour télécharger le json."
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 3640e0a0..f1a8e3b1 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Importa da > Wallabag v2' 466 page_title: 'Importa da > Wallabag v2'
467 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v2. Vai in "Tutti i contenuti", e, nella barra laterale di esportazione, clicca su "JSON". Otterrai un file "Tutti i contenuti.json' 467 description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v2. Vai in "Tutti i contenuti", e, nella barra laterale di esportazione, clicca su "JSON". Otterrai un file "Tutti i contenuti.json'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Importa da > Readability' 472 page_title: 'Importa da > Readability'
470 description: 'Questo importatore copierà tutti i tuoi articoli da Readability. Nella pagina strumenti (https://www.readability.com/tools/), clicca su "Export your data" nella sezione "Data Export". Riceverai una E-mail per scaricare un file json (che tuttavia non termina con .json).' 473 description: 'Questo importatore copierà tutti i tuoi articoli da Readability. Nella pagina strumenti (https://www.readability.com/tools/), clicca su "Export your data" nella sezione "Data Export". Riceverai una E-mail per scaricare un file json (che tuttavia non termina con .json).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index cd60566a..89bf8b16 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Importar > Wallabag v2' 466 page_title: 'Importar > Wallabag v2'
467 description: "Aquesta aisina importarà totas vòstras donadas d'una instància mai de wallabag v2. Anatz dins totes vòstres articles, puèi, sus la barra laterala, clicatz sus \"JSON\". Traparetz un fichièr \"All articles.json\"." 467 description: "Aquesta aisina importarà totas vòstras donadas d'una instància mai de wallabag v2. Anatz dins totes vòstres articles, puèi, sus la barra laterala, clicatz sus \"JSON\". Traparetz un fichièr \"All articles.json\"."
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Importar > Readability' 472 page_title: 'Importar > Readability'
470 description: "Aquesta aisina importarà totas vòstres articles de Readability. Sus la pagina de l'aisina (https://www.readability.com/tools/), clicatz sus \"Export your data\" dins la seccion \"Data Export\". Recebretz un corrièl per telecargar un json (qu'acaba pas amb un .json de fach)." 473 description: "Aquesta aisina importarà totas vòstres articles de Readability. Sus la pagina de l'aisina (https://www.readability.com/tools/), clicatz sus \"Export your data\" dins la seccion \"Data Export\". Recebretz un corrièl per telecargar un json (qu'acaba pas amb un .json de fach)."
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 909f7058..0118ad21 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Import > Wallabag v2' 466 page_title: 'Import > Wallabag v2'
467 description: 'Ten importer, zaimportuje wszystkie twoje artykułu z wallabag v2. Idź do wszystkich artykułów, a następnie na panelu exportu kliknij na "JSON". Otrzymasz plik "All articles.json".' 467 description: 'Ten importer, zaimportuje wszystkie twoje artykułu z wallabag v2. Idź do wszystkich artykułów, a następnie na panelu exportu kliknij na "JSON". Otrzymasz plik "All articles.json".'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Import > Readability' 472 page_title: 'Import > Readability'
470 description: 'Ten importer, zaimportuje wszystkie twoje artykuły z Readability. Na stronie narzędzi (https://www.readability.com/tools/), kliknij na "Export your data" w sekcji "Data Export". Otrzymach email z plikiem JSON (plik nie będzie zawierał rozszerzenia .json).' 473 description: 'Ten importer, zaimportuje wszystkie twoje artykuły z Readability. Na stronie narzędzi (https://www.readability.com/tools/), kliknij na "Export your data" w sekcji "Data Export". Otrzymach email z plikiem JSON (plik nie będzie zawierał rozszerzenia .json).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index 47e7b4db..d0082cda 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Importar > Wallabag v2' 466 page_title: 'Importar > Wallabag v2'
467 description: 'Com este importador você importa todos os seus artigos do wallabag v2. Vá em Todos os artigos e então, na barra lateral de exportação, clique em "JSON". Você irá criar um arquivo "All articles.json".' 467 description: 'Com este importador você importa todos os seus artigos do wallabag v2. Vá em Todos os artigos e então, na barra lateral de exportação, clique em "JSON". Você irá criar um arquivo "All articles.json".'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Importar > Readability' 472 page_title: 'Importar > Readability'
470 description: 'Este importador pode importar todos os artigos do Readability. Nas página ferramentas (https://www.readability.com/tools/), clique em "Export your data" na seção "Data Export". Você receberá um e-mail para fazer o download de um json (que de fato não termina com .json).' 473 description: 'Este importador pode importar todos os artigos do Readability. Nas página ferramentas (https://www.readability.com/tools/), clique em "Export your data" na seção "Data Export". Você receberá um e-mail para fazer o download de um json (que de fato não termina com .json).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 380b5233..c8e2dfb4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -465,6 +465,9 @@ import:
465 # wallabag_v2: 465 # wallabag_v2:
466 # page_title: 'Import > Wallabag v2' 466 # page_title: 'Import > Wallabag v2'
467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' 467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 # readability: 471 # readability:
469 # page_title: 'Import > Readability' 472 # page_title: 'Import > Readability'
470 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 473 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
index a47525c6..41379f90 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'Импорт > Wallabag v2' 466 page_title: 'Импорт > Wallabag v2'
467 description: 'Функция импорта добавит все ваши записи wallabag v2. Перейдите ко всем статьям, затем на боковой панели экспорта нажмите "JSON". У вас появится файл со всеми записями "All articles.json".' 467 description: 'Функция импорта добавит все ваши записи wallabag v2. Перейдите ко всем статьям, затем на боковой панели экспорта нажмите "JSON". У вас появится файл со всеми записями "All articles.json".'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'Импорт > Readability' 472 page_title: 'Импорт > Readability'
470 description: 'Функция импорта добавит все ваши записи для чтения. На странице инструментов (https://www.readability.com/tools/) нажмите "Экспорт ваших данных" в разделе "Экспорт данных". Вы получите электронное письмо для загрузки json (что не заканчивается только .json файлом).' 473 description: 'Функция импорта добавит все ваши записи для чтения. На странице инструментов (https://www.readability.com/tools/) нажмите "Экспорт ваших данных" в разделе "Экспорт данных". Вы получите электронное письмо для загрузки json (что не заканчивается только .json файлом).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
index 5879c48f..b5a3bcb6 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'นำเข้าข้อมูล > Wallabag v2' 466 page_title: 'นำเข้าข้อมูล > Wallabag v2'
467 description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ wallabag v2 ทั้งหมดของคุณ ไปยังบทความทั้งหมด, ดังนั้น, บน export sidebar, click ที่ "JSON" คุณจะมีไฟล์ "All articles.json"' 467 description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ wallabag v2 ทั้งหมดของคุณ ไปยังบทความทั้งหมด, ดังนั้น, บน export sidebar, click ที่ "JSON" คุณจะมีไฟล์ "All articles.json"'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'นำเข้าข้อมูล > Readability' 472 page_title: 'นำเข้าข้อมูล > Readability'
470 description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ Readability ทั้งหมดของคุณ ไปที่เครื่องมือ (https://www.readability.com/tools/) ของหน้านั้น, click ที่ "Export your data" ในส่วน "Data Export" คุณจะได้รับ email ไป download json (which does not end with .json in fact).' 473 description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ Readability ทั้งหมดของคุณ ไปที่เครื่องมือ (https://www.readability.com/tools/) ของหน้านั้น, click ที่ "Export your data" ในส่วน "Data Export" คุณจะได้รับ email ไป download json (which does not end with .json in fact).'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index d023e368..4aaef781 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -465,6 +465,9 @@ import:
465 wallabag_v2: 465 wallabag_v2:
466 page_title: 'İçe Aktar > Wallabag v2' 466 page_title: 'İçe Aktar > Wallabag v2'
467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' 467 # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.'
468 # elcurator:
469 # page_title: 'Import > elCurator'
470 # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.'
468 readability: 471 readability:
469 page_title: 'İçe Aktar > Readability' 472 page_title: 'İçe Aktar > Readability'
470 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' 473 # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).'
diff --git a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php
new file mode 100644
index 00000000..174c2c96
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php
@@ -0,0 +1,41 @@
1<?php
2
3namespace Wallabag\ImportBundle\Controller;
4
5use Symfony\Component\HttpFoundation\Request;
6use Symfony\Component\Routing\Annotation\Route;
7
8class ElcuratorController extends WallabagController
9{
10 /**
11 * @Route("/elcurator", name="import_elcurator")
12 */
13 public function indexAction(Request $request)
14 {
15 return parent::indexAction($request);
16 }
17
18 /**
19 * {@inheritdoc}
20 */
21 protected function getImportService()
22 {
23 $service = $this->get('wallabag_import.elcurator.import');
24
25 if ($this->get('craue_config')->get('import_with_rabbitmq')) {
26 $service->setProducer($this->get('old_sound_rabbit_mq.import_elcurator_producer'));
27 } elseif ($this->get('craue_config')->get('import_with_redis')) {
28 $service->setProducer($this->get('wallabag_import.producer.redis.elcurator'));
29 }
30
31 return $service;
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 protected function getImportTemplate()
38 {
39 return 'WallabagImportBundle:Elcurator:index.html.twig';
40 }
41}
diff --git a/src/Wallabag/ImportBundle/Import/ElcuratorImport.php b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php
new file mode 100644
index 00000000..d1281613
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php
@@ -0,0 +1,54 @@
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
5class ElcuratorImport extends WallabagImport
6{
7 /**
8 * {@inheritdoc}
9 */
10 public function getName()
11 {
12 return 'elcurator';
13 }
14
15 /**
16 * {@inheritdoc}
17 */
18 public function getUrl()
19 {
20 return 'import_elcurator';
21 }
22
23 /**
24 * {@inheritdoc}
25 */
26 public function getDescription()
27 {
28 return 'import.elcurator.description';
29 }
30
31 /**
32 * {@inheritdoc}
33 */
34 protected function prepareEntry($entry = [])
35 {
36 return [
37 'url' => $entry['url'],
38 'title' => $entry['title'],
39 'created_at' => $entry['created_at'],
40 'is_archived' => 0,
41 'is_starred' => $entry['is_saved'],
42 ] + $entry;
43 }
44
45 /**
46 * {@inheritdoc}
47 */
48 protected function setEntryAsRead(array $importedEntry)
49 {
50 $importedEntry['is_archived'] = 1;
51
52 return $importedEntry;
53 }
54}
diff --git a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml
index e9ecb846..0bf0e761 100644
--- a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml
@@ -48,6 +48,14 @@ services:
48 - "@wallabag_import.wallabag_v2.import" 48 - "@wallabag_import.wallabag_v2.import"
49 - "@event_dispatcher" 49 - "@event_dispatcher"
50 - "@logger" 50 - "@logger"
51 wallabag_import.consumer.amqp.elcurator:
52 class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
53 arguments:
54 - "@doctrine.orm.entity_manager"
55 - "@wallabag_user.user_repository"
56 - "@wallabag_import.elcurator.import"
57 - "@event_dispatcher"
58 - "@logger"
51 wallabag_import.consumer.amqp.firefox: 59 wallabag_import.consumer.amqp.firefox:
52 class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer 60 class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
53 arguments: 61 arguments:
diff --git a/src/Wallabag/ImportBundle/Resources/config/redis.yml b/src/Wallabag/ImportBundle/Resources/config/redis.yml
index 091cdba0..40a6e224 100644
--- a/src/Wallabag/ImportBundle/Resources/config/redis.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/redis.yml
@@ -126,6 +126,27 @@ services:
126 - "@event_dispatcher" 126 - "@event_dispatcher"
127 - "@logger" 127 - "@logger"
128 128
129 # elcurator
130 wallabag_import.queue.redis.elcurator:
131 class: Simpleue\Queue\RedisQueue
132 arguments:
133 - "@wallabag_core.redis.client"
134 - "wallabag.import.elcurator"
135
136 wallabag_import.producer.redis.elcurator:
137 class: Wallabag\ImportBundle\Redis\Producer
138 arguments:
139 - "@wallabag_import.queue.redis.elcurator"
140
141 wallabag_import.consumer.redis.elcurator:
142 class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
143 arguments:
144 - "@doctrine.orm.entity_manager"
145 - "@wallabag_user.user_repository"
146 - "@wallabag_import.elcurator.import"
147 - "@event_dispatcher"
148 - "@logger"
149
129 # firefox 150 # firefox
130 wallabag_import.queue.redis.firefox: 151 wallabag_import.queue.redis.firefox:
131 class: Simpleue\Queue\RedisQueue 152 class: Simpleue\Queue\RedisQueue
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml
index 973c0d03..d824da4a 100644
--- a/src/Wallabag/ImportBundle/Resources/config/services.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/services.yml
@@ -48,6 +48,18 @@ services:
48 tags: 48 tags:
49 - { name: wallabag_import.import, alias: wallabag_v2 } 49 - { name: wallabag_import.import, alias: wallabag_v2 }
50 50
51 wallabag_import.elcurator.import:
52 class: Wallabag\ImportBundle\Import\ElcuratorImport
53 arguments:
54 - "@doctrine.orm.entity_manager"
55 - "@wallabag_core.content_proxy"
56 - "@wallabag_core.tags_assigner"
57 - "@event_dispatcher"
58 calls:
59 - [ setLogger, [ "@logger" ]]
60 tags:
61 - { name: wallabag_import.import, alias: elcurator }
62
51 wallabag_import.readability.import: 63 wallabag_import.readability.import:
52 class: Wallabag\ImportBundle\Import\ReadabilityImport 64 class: Wallabag\ImportBundle\Import\ReadabilityImport
53 arguments: 65 arguments:
diff --git a/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig
new file mode 100644
index 00000000..e3a0d709
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig
@@ -0,0 +1,3 @@
1{% extends "WallabagImportBundle:WallabagV1:index.html.twig" %}
2
3{% block title %}{{ 'import.elcurator.page_title'|trans }}{% endblock %}
diff --git a/tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php
new file mode 100644
index 00000000..18507054
--- /dev/null
+++ b/tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php
@@ -0,0 +1,132 @@
1<?php
2
3namespace Tests\Wallabag\ImportBundle\Controller;
4
5use Symfony\Component\HttpFoundation\File\UploadedFile;
6use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
7
8class ElcuratorControllerTest extends WallabagCoreTestCase
9{
10 public function testImportElcurator()
11 {
12 $this->logInAs('admin');
13 $client = $this->getClient();
14
15 $crawler = $client->request('GET', '/import/elcurator');
16
17 $this->assertSame(200, $client->getResponse()->getStatusCode());
18 $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count());
19 $this->assertSame(1, $crawler->filter('input[type=file]')->count());
20 }
21
22 public function testImportElcuratorWithRabbitEnabled()
23 {
24 $this->logInAs('admin');
25 $client = $this->getClient();
26
27 $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 1);
28
29 $crawler = $client->request('GET', '/import/elcurator');
30
31 $this->assertSame(200, $client->getResponse()->getStatusCode());
32 $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count());
33 $this->assertSame(1, $crawler->filter('input[type=file]')->count());
34
35 $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0);
36 }
37
38 public function testImportElcuratorBadFile()
39 {
40 $this->logInAs('admin');
41 $client = $this->getClient();
42
43 $crawler = $client->request('GET', '/import/elcurator');
44 $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
45
46 $data = [
47 'upload_import_file[file]' => '',
48 ];
49
50 $client->submit($form, $data);
51
52 $this->assertSame(200, $client->getResponse()->getStatusCode());
53 }
54
55 public function testImportElcuratorWithRedisEnabled()
56 {
57 $this->checkRedis();
58 $this->logInAs('admin');
59 $client = $this->getClient();
60
61 $client->getContainer()->get('craue_config')->set('import_with_redis', 1);
62
63 $crawler = $client->request('GET', '/import/elcurator');
64
65 $this->assertSame(200, $client->getResponse()->getStatusCode());
66 $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count());
67 $this->assertSame(1, $crawler->filter('input[type=file]')->count());
68
69 $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
70
71 $file = new UploadedFile(__DIR__ . '/../fixtures/elcurator.json', 'elcurator.json');
72
73 $data = [
74 'upload_import_file[file]' => $file,
75 ];
76
77 $client->submit($form, $data);
78
79 $this->assertSame(302, $client->getResponse()->getStatusCode());
80
81 $crawler = $client->followRedirect();
82
83 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
84 $this->assertContains('flashes.import.notice.summary', $body[0]);
85
86 $this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.elcurator'));
87
88 $client->getContainer()->get('craue_config')->set('import_with_redis', 0);
89 }
90
91 public function testImportElcuratorWithFile()
92 {
93 $this->logInAs('admin');
94 $client = $this->getClient();
95
96 $crawler = $client->request('GET', '/import/elcurator');
97 $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
98
99 $file = new UploadedFile(__DIR__ . '/../fixtures/elcurator.json', 'elcurator.json');
100
101 $data = [
102 'upload_import_file[file]' => $file,
103 ];
104
105 $client->submit($form, $data);
106
107 $this->assertSame(302, $client->getResponse()->getStatusCode());
108
109 $crawler = $client->followRedirect();
110
111 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
112 $this->assertContains('flashes.import.notice.summary', $body[0]);
113
114 $content = $client->getContainer()
115 ->get('doctrine.orm.entity_manager')
116 ->getRepository('WallabagCoreBundle:Entry')
117 ->findByUrlAndUserId(
118 'https://devblog.lexik.fr/qualite-de-code-integration-de-php-git-hooks-dans-symfony2/',
119 $this->getLoggedInUserId()
120 );
121
122 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
123
124 $this->assertSame('Qualité de code - Intégration de php-git-hooks dans Symfony2 - Experts Symfony et Drupal - Lexik', $content->getTitle());
125 $this->assertSame('2015-09-09', $content->getCreatedAt()->format('Y-m-d'));
126 $this->assertTrue($content->isStarred(), 'Entry is starred');
127
128 $tags = $content->getTags();
129 $this->assertContains('tag1', $tags, 'It includes the "tag1" tag');
130 $this->assertContains('tag2', $tags, 'It includes the "tag2" tag');
131 }
132}
diff --git a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php
index e1ec7c65..f0edb78d 100644
--- a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php
+++ b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php
@@ -24,6 +24,6 @@ class ImportControllerTest extends WallabagCoreTestCase
24 $crawler = $client->request('GET', '/import/'); 24 $crawler = $client->request('GET', '/import/');
25 25
26 $this->assertSame(200, $client->getResponse()->getStatusCode()); 26 $this->assertSame(200, $client->getResponse()->getStatusCode());
27 $this->assertSame(8, $crawler->filter('blockquote')->count()); 27 $this->assertSame(9, $crawler->filter('blockquote')->count());
28 } 28 }
29} 29}
diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php
index 90192278..963759b1 100644
--- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php
+++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php
@@ -121,6 +121,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
121 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); 121 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
122 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok'); 122 $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok');
123 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok'); 123 $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok');
124 $this->assertNull($content->getLanguage(), 'Language for https://ma.ttias.be is null');
124 125
125 $tags = $content->getTags(); 126 $tags = $content->getTags();
126 $this->assertContains('foot', $tags, 'It includes the "foot" tag'); 127 $this->assertContains('foot', $tags, 'It includes the "foot" tag');
diff --git a/tests/Wallabag/ImportBundle/fixtures/elcurator.json b/tests/Wallabag/ImportBundle/fixtures/elcurator.json
new file mode 100644
index 00000000..58972d93
--- /dev/null
+++ b/tests/Wallabag/ImportBundle/fixtures/elcurator.json
@@ -0,0 +1,13 @@
1[
2 {
3 "created_at": "2015-09-09 11:10:32 UTC",
4 "title": "Qualité de code - Intégration de php-git-hooks dans Symfony2 - Experts Symfony et Drupal - Lexik",
5 "url": "https://devblog.lexik.fr/qualite-de-code-integration-de-php-git-hooks-dans-symfony2/",
6 "description": null,
7 "tags": [
8 "tag1",
9 "tag2"
10 ],
11 "is_saved": true
12 }
13]