<?php require_once './vendor/autoload.php'; define('CLIENT_SECRET', 'ICBQUl3BaScF9Wu4upKFfLoo5CizYFTn'); if (isset($_GET['code'])) { $client = new Onenotem\OauthClient(); $client->prepareAccessToken($_GET['code']); } header('Location: http://blackpost.net/onenotem/index.php'); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>redirect</title> </head> <body> </body> </html>
<?php require_once './vendor/autoload.php'; $client = new Onenotem\OauthClient(); if (!isset($_COOKIE['ACCESS_TOKEN'])) { $client->getAuthorizationCode(); exit; } if (isset($_COOKIE['ACCESS_TOKEN']) && isset($_GET['type'])) { switch ($_GET['type']) { case 'notebooks': $notebooks = $client->getNotebooks(); break; case 'sections': $sections = $client->getSections($_GET['id']); break; case 'pages': $pages = $client->getPages($_GET['id']); break; case 'page_content': $pageContent = $client->getPage($_GET['id']); $htmlText = Onenotem\Converter::render($pageContent); $markdownText = Onenotem\Converter::convert($htmlText); break; default: } } ?> <!DOCTYPE html> <html>