', $xml)) as $element) {
if($limit >= 5) {
break;
}
if(strpos($element, '') === false) {
continue;
}
$releasename = extractFromDelimiters($element, '', '');
if(empty($releasename)) {
continue;
}
$id = extractFromDelimiters($element, '', '');
$name = extractFromDelimiters($element, '', '');
$publisher = extractFromDelimiters($element, '', '');
$region = extractFromDelimiters($element, '', '');
$group = extractFromDelimiters($element, '', '');
$imagesize = extractFromDelimiters($element, '', '');
$serial = extractFromDelimiters($element, '', '');
$titleid = extractFromDelimiters($element, '', '');
$imgcrc = extractFromDelimiters($element, '', '');
$filename = extractFromDelimiters($element, '', '');
$trimmedsize = extractFromDelimiters($element, '', '');
$firmware = extractFromDelimiters($element, '', '');
$type = extractFromDelimiters($element, '', '');
$card = extractFromDelimiters($element, '', '');
//Retrieve cover art and short desc from IGN?
$ignResult = false;
$ignDescription = '';
$ignLink = '';
$ignDate = time();
$ignCoverArt = '';
$ignSearchUrl = 'https://www.ign.com/search?q=' . urlencode($name);
if($ignResult = getSimpleHTMLDOMCached($ignSearchUrl)) {
$ignCoverArt = $ignResult->find('div.search-item-media', 0)->find('img', 0)->src;
$ignDesc = $ignResult->find('div.search-item-description', 0)->plaintext;
$ignLink = $ignResult->find('div.search-item-sub-title', 0)->find('a', 1)->href;
$ignDate = strtotime(trim($ignResult->find('span.publish-date', 0)->plaintext));
$ignDescription = '
';
}
//Main section : Release description from 3DS database
$releaseDescription = 'Release Details
Release ID: ' . $id
. '
Game Name: ' . $name
. '
Publisher: ' . $publisher
. '
Region: ' . $region
. '
Group: ' . $group
. '
Image size: ' . (intval($imagesize) / 8)
. 'MB
Serial: ' . $serial
. '
Title ID: ' . $titleid
. '
Image CRC: ' . $imgcrc
. '
File Name: ' . $filename
. '
Release Name: ' . $releasename
. '
Trimmed size: ' . intval(intval($trimmedsize) / 1048576)
. 'MB
Firmware: ' . $firmware
. '
Type: ' . typeToString($type)
. '
Card: ' . cardToString($card)
. '
';
//Build search links section to facilitate release search using search engines
$releaseNameEncoded = urlencode(str_replace(' ', '+', $releasename));
$searchLinkGoogle = 'https://google.com/?q=' . $releaseNameEncoded;
$searchLinkDuckDuckGo = 'https://duckduckgo.com/?q=' . $releaseNameEncoded;
$searchLinkQwant = 'https://lite.qwant.com/?q=' . $releaseNameEncoded . '&t=web';
$releaseSearchLinks = 'Search this release
';
//Build and add final item with the above three sections
$item = array();
$item['title'] = $name;
$item['author'] = $publisher;
$item['timestamp'] = $ignDate;
$item['enclosures'] = array($ignCoverArt);
$item['uri'] = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink;
$item['content'] = $ignDescription . $releaseDescription . $releaseSearchLinks;
$this->items[] = $item;
$limit++;
}
}
}