forked from saleandro/songkick-wp-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
songkick_user_events.php
38 lines (34 loc) · 1.14 KB
/
songkick_user_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
36
37
38
<?php
require_once dirname(__FILE__) . '/songkick_events.php';
class SongkickUserEvents extends SongkickEvents {
public $username;
public $apikey;
function SongkickUserEvents($apikey, $username, $attendance='all', $gigography=true, $order=null) {
$this->SongkickEvents($apikey);
$this->attendance = $attendance;
$this->username = trim($username);
$this->gigography = $gigography;
$this->order = $order;
}
function profile_url() {
return "http://www.songkick.com/users/$this->username";
}
protected function url($page, $per_page) {
if ($this->gigography) {
$method = "gigography";
if (!$this->order)
$this->order = 'desc';
} else {
$method = "events";
if (!$this->order)
$this->order = 'asc';
}
$url = "$this->apiurl/users/$this->username/$method.json?apikey=$this->apikey";
$url .= "&order=$this->order&per_page=$per_page&page=$page";
if ($this->attendance) {
$url .= "&attendance=$this->attendance";
}
return $url;
}
}
?>