1 | <?php |
||
7 | class PinnerHelper extends RequestHelper |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Creates Pinterest API request to get user info according to |
||
12 | * username, API url and bookmarks for pagination |
||
13 | * |
||
14 | * @param string $username |
||
15 | * @param string $sourceUrl |
||
16 | * @param array $bookmarks |
||
17 | * @return array |
||
18 | */ |
||
19 | public static function createUserDataRequest($username, $sourceUrl, $bookmarks) |
||
25 | |||
26 | /** |
||
27 | * Parses Pinterest API response with pinner name |
||
28 | * |
||
29 | * @param $res |
||
30 | * @return null |
||
31 | */ |
||
32 | public static function parseAccountNameResponse($res) |
||
40 | |||
41 | /** |
||
42 | * Creates Pinterest API request to login |
||
43 | * |
||
44 | * @param string $username |
||
45 | * @param string $password |
||
46 | * @return array |
||
47 | */ |
||
48 | public static function createLoginRequest($username, $password) |
||
59 | |||
60 | /** |
||
61 | * Parses Pintrest Api response after login |
||
62 | * |
||
63 | * @param array $res |
||
64 | * @return bool |
||
65 | * @throws AuthException |
||
66 | */ |
||
67 | public static function parseLoginResponse($res) |
||
75 | |||
76 | /** |
||
77 | * Creates common Pinner request data by username |
||
78 | * |
||
79 | * @param string $username |
||
80 | * @return array |
||
81 | */ |
||
82 | protected static function createPinnerRequestData($username) |
||
91 | |||
92 | } |
||
93 |