1
0
mirror of https://github.com/Rogiel/predb synced 2025-12-06 07:32:47 +00:00

Implements pagination

This commit is contained in:
2014-11-23 15:48:37 -02:00
parent 68cf6fc064
commit d8a338d345
4 changed files with 35 additions and 25 deletions

View File

@@ -32,10 +32,8 @@
namespace PreDB\Adapter;
use PreDB\Release;
use DOMDocument;
use DOMXPath;
use DateTime;
use DateTimeZone;
@@ -48,13 +46,13 @@ use DateTimeZone;
*/
class OrlyDB implements Adapter {
public function latest() {
$html = file_get_contents("http://orlydb.com/1");
public function latest($page = 1) {
$html = file_get_contents("http://orlydb.com/" . $page);
return $this->parseList($html);
}
public function search($release) {
$html = file_get_contents("http://orlydb.com/?q=" . urlencode($release));
public function search($release, $page = 1) {
$html = file_get_contents("http://orlydb.com/{$page}?q=" . urlencode($release));
return $this->parseList($html);
}