<?php
$Tool_filter = null;
if(isset($Filter['category'])) {
	$Tool_filter .= '&category='.$Filter['category'];
}
if(isset($Filter['sort'])) {
	$Tool_filter .= '&popularity='.$Filter['sort'];
} 
if(isset($_GET['page'])) {
	$Tool_filter .= '&page='.$_GET['page'];
}
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://gamemonetize.com/feed.php?format=0&num=50'.$Tool_filter, ['verify' => false]);

// Listings
$Items 		= json_decode($response->getBody(),true);
$Listings = [];
foreach ($Items as $Item) { 
	$Listings[] = [
		'id'			=> $Item['id'],
		'api_type'		=> 'gamemonetize',
		'title'			=> $Item['title'],
		'category'		=> $Filter['category'],
		'category_name'	=> $Item['category'],
		'description'	=> $Item['description'],
		'control'		=> $Item['instructions'],
		'image'			=> $Item['thumb'],
		'tags'			=> $Item['tags'],
		'width'			=> $Item['width'],
		'height'		=> $Item['height'],
		'file'			=> $Item['url']
	]; 
}   

// Pagination
$Paginations = [];
for ($i=1; $i <=10; $i++) {  
	$Paginations[] = [
		'name'		=> trim($i),
		'url'		=> trim($i)
	];  
}   