This is one of four ways to display POOL distribution paginated by date. This view will show all available tracks arranged in order by date, in a paginated view. The default view will show 15 dates in descending order (most recent dates displayed first).
Example JSON Output
[
{
"date": "2020-04-09",
"tracks":
[
{
"artist": "The Killers",
"bpm": 89,
"content_warning": false,
"downloaded": 0,
"duration": 224,
"end": "Cold",
"explicit": 0,
"formatid": 18,
"genre": "Alternative",
"label": "Island/Republic",
"media_type": 2,
"mix": "",
"modified": 1586448139,
"release": "Modern Rock Radio May 2020",
"release_artist": "Promo Only",
"release_image": "https://pomed.promoonly.com/issue_imgs/mrr0520_web.png",
"release_ts": 1586390400,
"releaseid": 56005,
"title": "Caution",
"titleid": 627133,
"trackid": 374660
},
{
"artist": "Benee f./Gus Dapperton",
"bpm": 129,
"content_warning": true,
"downloaded": 0,
"duration": 220,
"end": "Cold",
"explicit": 0,
"formatid": 18,
"genre": "Alternative",
"label": "Casablanca/Republic",
"media_type": 2,
"mix": "Clean Edit",
"modified": 1586448139,
"release": "Modern Rock Radio May 2020",
"release_artist": "Promo Only",
"release_image": "https://pomed.promoonly.com/issue_imgs/mrr0520_web.png",
"release_ts" :1586390400,
"releaseid": 56005,
"title": "Supalonely",
"titleid": 626536,
"trackid": 374661
}
],
"ts": 1586390400
},
{
"date": "2020-04-08",
"tracks":
[
{
"artist": "Lotto Boyzz f./Dappy",
"bpm": 106,
"content_warning": false,
"downloaded": 0,
"duration": 223,
"end": "Cold",
"explicit": 0,
"formatid": 71,
"genre": "",
"label": "Columbia",
"media_type": 1,
"mix": "",
"modified": 1586343614,
"release": "Chart Video HD Daily (4-8-2020)",
"release_artist": "Promo Only",
"release_image": "https://pomed.promoonly.com/issue_imgs/cve_daily.jpg",
"release_ts": 1586304000,
"releaseid": 56464,
"title": "+44",
"titleid": 628121,
"trackid": 374511
},
{
"artist": "Lotto Boyzz f./Dappy",
"bpm": 106,
"content_warning": true,
"downloaded": 0,
"duration": 223,
"end": "Cold",
"explicit": 1,
"formatid": 71,
"genre": "",
"label": "Columbia",
"media_type": 1,
"mix": "Explicit",
"modified": 1586343614,
"release": "Chart Video HD Daily (4-8-2020)",
"release_artist": "Promo Only",
"release_image": "https://pomed.promoonly.com/issue_imgs/cve_daily.jpg",
"release_ts": 1586304000,
"releaseid": 56464,
"title": "+44",
"titleid": 628122,
"trackid": 374512
}
],
"ts": 1586304000
}
]
PHP (using cURL):
<?php
$userid = 1;
$token = "8b26e1e4f3f5e00a888807e605565c47";
$date_tracks_url = "https://api.promoonly.com/tracks/date/1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $date_tracks_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".base64_encode($userid.":".$token)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$date_tracks_result = curl_exec($ch);
curl_close($ch);
$date_tracks_obj = json_decode($date_tracks_result);
?>
Javascript (using jQuery):
function b64EncodeUnicode(str)
{
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
function toSolidBytes(match, p1)
{
return String.fromCharCode('0x' + p1);
}));
}
var userid = 1;
var token = "8b26e1e4f3f5e00a888807e605565c47";
var auth_str = "Bearer " + b64EncodeUnicode(userid + ":" + token);
$.ajax({
type: "GET",
url: "https://api.promoonly.com/tracks/date/1",
headers: { "Authorization": auth_str },
dataType: "json",
success: function (data)
{
console.log(data);
}
});
Python (using requests):
#!/usr/bin/env python
import requests
import base64
import urllib
userid = 1
token = "8b26e1e4f3f5e00a888807e605565c47"
b64_key = base64.b64encode("%s:%s" % (userid, token))
headers = {"Authorization": "Bearer %s" % b64_key}
date_tracks_url = "https://api.promoonly.com/tracks/date/1"
result_return = requests.get(date_tracks_url, headers=headers)
print(result_return.text)