3 namespace Wallabag\ImportBundle\Controller
;
5 use Symfony\Bundle\FrameworkBundle\Controller\Controller
;
6 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
;
8 class PocketController
extends Controller
11 * @Route("/import/pocket", name="pocket")
13 public function indexAction()
15 return $this->render('WallabagImportBundle:Pocket:index.html.twig', array());
19 * @Route("/import/pocket/auth", name="authpocket")
21 public function authAction()
23 $pocket = $this->get('wallabag_import.import.pocket_import');
24 $authUrl = $pocket->oAuthRequest($this->generateUrl('import', array(), true), $this->generateUrl('callbackpocket', array(), true));
26 return $this->redirect($authUrl, 301);
30 * @Route("/import/pocket/callback", name="callbackpocket")
32 public function callbackAction()
34 $pocket = $this->get('wallabag_import.import.pocket_import');
35 $accessToken = $pocket->oAuthAuthorize();
36 $pocket->import($accessToken);
38 return $this->redirect($this->generateUrl('homepage'));