3 namespace Wallabag\ImportBundle\Controller
;
5 use Symfony\Bundle\FrameworkBundle\Controller\Controller
;
6 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
;
7 use Wallabag\ImportBundle\Import\PocketImport
;
9 class PocketController
extends Controller
12 * @Route("/import", name="import")
14 public function importAction()
16 return $this->render('WallabagImportBundle:Pocket:index.html.twig', array());
20 * @Route("/auth-pocket", name="authpocket")
22 public function authAction()
24 $pocket = $this->get('wallabag_import.import.pocket_import');
25 $authUrl = $pocket->oAuthRequest($this->generateUrl('import', array(), true), $this->generateUrl('callbackpocket', array(), true));
27 return $this->redirect($authUrl, 301);
31 * @Route("/callback-pocket", name="callbackpocket")
33 public function callbackAction()
35 $pocket = $this->get('wallabag_import.import.pocket_import');
36 $accessToken = $pocket->oAuthAuthorize();
37 $pocket->import($accessToken);
39 return $this->redirect($this->generateUrl('homepage'));