示例#1
0
<?php

require_once "../yakwala_api.class.php";
$name = array_key_exists("name", $_GET) ? $_GET['name'] : "Yakwala";
// Set your client key and secret
$client_key = "50a0e2c4fa9a95240b000001";
$client_secret = "5645a25f963bd0ac846b17eb517cd638754f1a7b";
$redirect_uri = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
// Load the Yakwala API library
$yakwala = new YakwalaAPI($client_key, $client_secret);
if (array_key_exists("code", $_GET)) {
    $userid = "50af3cc0540c32480c000002";
    // SEARCH TAGS
    $params = array('limit' => 0, 'skip' => 0, 'sort' => 'lastUsed');
    $response = $yakwala->GetPublic("api/tag/search/no", $params);
    $taglist = json_decode($response);
    echo "<br><br> <b>TAGS SEARCH RESULTS:</b> tag/search/no<br>";
    print_r($taglist);
    // SEARCH YAKCAT
    $params = array('limit' => 0, 'skip' => 0);
    $response = $yakwala->GetPublic("api/cat/search/spor", $params);
    $catlist = json_decode($response);
    echo "<br><br> <b>YAKCAT SEARCH RESULTS:</b> cat/search/spor<br>";
    print_r($catlist);
    // SEARCH USERS
    $params = array('limit' => 0, 'skip' => 0);
    $response = $yakwala->GetPublic("api/user/search/Rebe", $params);
    $userlist = json_decode($response);
    echo "<br><br> <b>USERS SEARCH RESULTS:</b> users/search/rebe<br>";
    print_r($userlist);
    // SEARCH PLACES
示例#2
0
// Set your client key and secret
$client_key = "50a0e2c4fa9a95240b000001";
$client_secret = "5645a25f963bd0ac846b17eb517cd638754f1a7b";
$redirect_uri = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
// Load the Yakwala API library
$yakwala = new YakwalaAPI($client_key, $client_secret);
if (array_key_exists("code", $_GET)) {
    // get the user id
    $response = $yakwala->GetToken($_GET['code'], $redirect_uri);
    echo 'TOKEN' . $response->access_token;
    $yakwala->SetAccessToken($response->access_token);
    $userid = $response->user->id;
    // PLACES FORM IDS
    // both parameters are working :
    $params = array('place' => urlencode(json_encode(array('50cef8f8087542a812000006', '50ceeb60cb7b8e2410000010'))));
    $response = $yakwala->GetPublic("api/place/" . $userid, $params);
    $places = json_decode($response);
    var_dump($places);
    echo "<br><br> <b>PLACES FROM IDS:</b><br>";
    foreach ($places->data as $place) {
        echo $place->title . "<br>";
    }
    // USERS PROFILE
    $response = $yakwala->GetPublic("api/user/" . $userid, $params);
    $user = json_decode($response);
    echo "<br><br> <b>USER'S PROFILE:</b><br>";
    print_r($user);
    // USERS FEEDS
    $params = array('limit' => 0, 'skip' => 0);
    $response = $yakwala->GetPublic("api/user/feed/" . $userid, $params);
    $infos = json_decode($response);