Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $accessToken = $_SESSION['accessToken'];
- $client = new Client(array(
- 'token' => $accessToken,
- 'sandbox' => SANDBOX
- ));
- $notebooks = $client->getNoteStore()->listNotebooks();
- $result = array();
- $result2 = array();
- if (!empty($notebooks)) {
- foreach ($notebooks as $notebook) {
- $nbguids[] = $notebook->guid;
- }
- }
- if (!empty($nbguids)) {
- foreach ($nbguids as $nbguid) {
- $filter = new NoteFilter();;
- $filter->notebookGuid = $nbguid;
- $notes = $client->getNoteStore()->findNotes($accessToken, $filter, 0, 100); // Fetch up to 100 notes
- if (!empty($notes->notes)) {
- foreach ($notes->notes as $note) {
- $result[] = $note->title;
- $result2[] = $note->guid;
- }
- }
- }
- $_SESSION['notes_title'] = $result;
- $_SESSION['notes_guid'] = $result2;
Advertisement
Add Comment
Please, Sign In to add comment