forked from saleandro/songkick-wp-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsongkick_artist_events.php
35 lines (30 loc) · 983 Bytes
/
songkick_artist_events.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once dirname(__FILE__) . '/songkick_events.php';
class SongkickArtistEvents extends SongkickEvents {
public $id;
public $apikey;
function SongkickArtistEvents($apikey, $id, $gigography=false, $order=null) {
$this->SongkickEvents($apikey);
$this->id = trim($id);
$this->gigography = $gigography;
$this->order = $order;
}
function profile_url() {
return "http://www.songkick.com/artists/$this->id";
}
protected function url($page, $per_page) {
if ($this->gigography) {
$method = "gigography";
if (!$this->order)
$this->order = 'desc';
} else {
$method = "calendar";
if (!$this->order)
$this->order = 'asc';
}
$url = "$this->apiurl/artists/$this->id/$method.json?apikey=$this->apikey";
$url .= "&order=$this->order&per_page=$per_page&page=$page";
return $url;
}
}
?>