function check_token($FQDN, $api_key, $secret_key, $scope, $fullToken, $oauth_file) { $currentTime = time(); if ($fullToken["updateTime"] == null || $fullToken["updateTime"] <= $currentTime) { $fullToken = GetAccessToken($FQDN, $api_key, $secret_key, $scope); if ($fullToken["accessToken"] == null) { // echo $fullToken["errorMessage"]; } else { // echo $fullToken["accessToken"]; SaveToken($fullToken, $oauth_file); } } elseif ($fullToken["refreshTime"] <= $currentTime) { $fullToken = RefreshToken($FQDN, $api_key, $secret_key, $scope, $fullToken); if ($fullToken["accessToken"] == null) { // echo $fullToken["errorMessage"]; } else { // echo $fullToken["accessToken"]; SaveToken($fullToken, $oauth_file); } } return $fullToken; }
// "category_id":"MLA3530", // "price":109, // "currency_id":"ARS", // "available_quantity":1, // "buying_mode":"buy_it_now", // "listing_type_id":"bronze", // "condition":"new", // "description": "Item:, Ray-Ban WAYFARER Gloss Black RB2140 901 Model: RB2140. Size: 50mm. Name: WAYFARER. Color: Gloss Black. Includes Ray-Ban Carrying Case and Cleaning Cloth. New in Box", // "video_id": "RXWn6kftTHY", // "warranty": "12 months by Ray Ban", // "pictures":[ // {"source":"https://upload.wikimedia.org/wikipedia/commons/f/fd/Ray_Ban_Original_Wayfarer.jpg"}, // {"source":"https://en.wikipedia.org/wiki/File:Teashades.gif"} // ] // }'); RefreshToken($Meli); //http://articulo.mercadolibre.com.ar/MLA-628460854-ropa-de-cama-mujer-item-de-testeo-no-ofertar-_JM $Item = json_decode('{ "title":"Ropa de Cama Mujer - Item de testeo - No Ofertar", "category_id":"MLA111469", "price":109, "currency_id":"ARS", "buying_mode":"buy_it_now", "listing_type_id":"bronze", "condition":"new", "description": "Item de testeo. No ofertar.", "variations":[ { "attribute_combinations":[ { "id":"93000",