-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
31 lines (26 loc) · 807 Bytes
/
index.php
File metadata and controls
31 lines (26 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
header('Content-type: application/json');
/* Require the Pinterest API class */
require_once("lib/Pinterest.class.php");
// Create new instance of the Pinterest API
$pinterest = new Pinterest("pinterest");
// Check if a page has to be set
if(isset($_GET['page'])){
$pinterest->currentpage = (int) $_GET['page'];
}
// Check the action
switch($_GET['action']){
case "getboards":
$resp = $pinterest->getBoards();
break;
case "getpinsfromboard":
$resp = $pinterest->getPinsFromBoard($_GET["board"]);
break;
case "getpins":
default:
$resp = $pinterest->getPins();
break;
}
// Return the data
echo json_encode( $resp );
?>