This is one of four ways to display POOL distribution paginated by date. This view will show all available releases 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",
"releases":
[
{
"artist": "Elderbrook",
"downloaded": 0,
"formatid": 88,
"genre": "Dance",
"id": 56596,
"image_url": "https://s3.amazonaws.com/pool.images/56596.jpg",
"label": "Big Beat/EMG",
"label_url": "https://loop.promoonly.com/assets/po_small.png",
"modified": 1586437487,
"release": "Numb (Remixes)",
"tracks": 4,
"type": 2
},
{
"artist": "Promo Only",
"downloaded": 0,
"formatid": 67,
"genre": "Compilation",
"id": 56514,
"image_url": "https://pomed.promoonly.com/issue_imgs/hits_hd_web.jpg",
"label": "Promo Only Issue",
"label_url": "https://loop.promoonly.com/assets/po_small.png",
"modified": 1586428977,
"release": "Hits HD (4-23-2020)",
"tracks": 11,
"type": 1
}
],
"ts": 1586390400
},
{
"date": "2020-04-08",
"releases":
[
{
"artist": "Promo Only",
"downloaded": 0,
"formatid": 71,
"genre": "Compilation",
"id": 56464,
"image_url": "https://pomed.promoonly.com/issue_imgs/cve_daily.jpg",
"label": "Promo Only Issue",
"label_url": "https://loop.promoonly.com/assets/po_small.png",
"modified": 1586343614,
"release": "Chart Video HD Daily (4-8-2020)",
"tracks": 6,
"type": 1
},
{
"artist": "Promo Only",
"downloaded": 0,
"formatid": 71,
"genre": "Compilation",
"id": 56548,
"image_url": "https://pomed.promoonly.com/issue_imgs/cve_daily.jpg",
"label": "Promo Only Issue",
"label_url": "https://loop.promoonly.com/assets/po_small.png",
"modified": 1586431682,
"release": "Chart Video HD Daily (4-9-2020)",
"tracks": 6,
"type": 1
}
],
"ts": 1586304000
}
]
PHP (using cURL):
<?php
$userid = 1;
$token = "8b26e1e4f3f5e00a888807e605565c47";
$date_releases_url = "https://api.promoonly.com/releases/date/1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $date_releases_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".base64_encode($userid.":".$token)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$date_releases_result = curl_exec($ch);
curl_close($ch);
$date_releases_obj = json_decode($date_releases_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/releases/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_releases_url = "https://api.promoonly.com/releases/date/1"
result_return = requests.get(date_releases_url, headers=headers)
print(result_return.text)