Skip to content

Instantly share code, notes, and snippets.

@Halleck45
Created September 12, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Halleck45/f316b4602f3b82dc9b9ffdddd39e7994 to your computer and use it in GitHub Desktop.
Save Halleck45/f316b4602f3b82dc9b9ffdddd39e7994 to your computer and use it in GitHub Desktop.
Youbora support
<?php
// This file concerns Youbora support
$secretKey = 'mysecret';
$system = 'system'
$url = '/quality/top?system='.$system.'&timezone=Europe/Paris&type=&asc=true&orderBy=plays&startDate=&endDate=';
$expirationTime = round(microtime(true) * 1000) + 1800000;
$preurl = $url . "&dateToken=".$expirationTime;
$token = md5($preurl.$secretKey);
// tried with
//$url = 'https://api.youbora.com/'.$preurl;
$url = 'http://ws.analytics.nicepeopleatwork.com'.$preurl. '&token=' . $token;
var_dump($url);
var_dump(file_get_contents($url));
/*
getting:
string 'http://ws.analytics.nicepeopleatwork.com/quality/top?system=radiofrance&timezone=Europe/Paris&type=&asc=true&orderBy=plays&startDate=&endDate=&dateToken=1505205917032&token=0a62fbbe6d0fc0c40bef7e5df4dc4360' (length=205)
string '{"errorcode": 3002,"errormsg": "Invalid token."}' (length=48)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment