Example #1
0
 /** Get all events in a specific location by country or city name.
  *
  * @param	string	$location	Specifies a location to retrieve events for (service returns nearby events by default). (Optional)
  * @param	float	$lat		Specifies a latitude value to retrieve events for (service returns nearby events by default). (Optional)
  * @param	float	$long		Specifies a longitude value to retrieve events for (service returns nearby events by default). (Optional)
  * @param	integer	$distance	Find events within a specified distance. (Optional)
  * @param	integer	$page		Display more results by pagination. (Optional)
  * @return	PaginatedResult		A PaginatedResult object.
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getEvents($location = null, $lat = null, $long = null, $distance = null, $page = null)
 {
     $xml = CallerFactory::getDefaultCaller()->call('geo.getEvents', array('location' => $location, 'lat' => $lat, 'long' => $long, 'distance' => $distance, 'page' => $page));
     $events = array();
     foreach ($xml->children() as $event) {
         $events[] = Event::fromSimpleXMLElement($event);
     }
     $perPage = intval(ceil(Util::toInteger($xml['total']) / Util::toInteger($xml['totalpages'])));
     return new PaginatedResult(Util::toInteger($xml['total']), (Util::toInteger($xml['page']) - 1) * $perPage, $perPage, $events);
 }
Example #2
0
 /** Get a paginated list of all events recommended to a user by last.fm, based on their listening profile.
  *
  * @param	integer	$limit	The number of events to return per page. (Optional)
  * @param	integer	$page	The page number to scan to. (Optional)
  * @return	PaginatedResult	A PaginatedResult object.
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getRecommendedEvents($limit = null, $page = null, $session)
 {
     $xml = CallerFactory::getDefaultCaller()->signedCall('user.getRecommendedEvents', array('limit' => $limit, 'page' => $page), $session);
     $events = array();
     foreach ($xml->children() as $event) {
         $events[] = Event::fromSimpleXMLElement($event);
     }
     $perPage = Util::toInteger($xml['perPage']);
     return new PaginatedResult(Util::toInteger($xml['total']), (Util::toInteger($xml['page']) - 1) * $perPage, $perPage, $events);
 }
Example #3
0
 /** Get the metadata for an event on last.fm. Includes attendance and lineup information.
  *
  * @param	integer	$event	The numeric last.fm event ID. (Required)
  * @return	mixed			An Event object.
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getInfo($event)
 {
     $xml = CallerFactory::getDefaultCaller()->call('event.getInfo', array('event' => $event));
     return Event::fromSimpleXMLElement($xml);
 }
Example #4
0
 /** Get a paginated list of all the events held at this venue in the past.
  *
  * @param	string	$venue	The id for the venue you would like to fetch event listings for. (Required)
  * @param	integer	$limit	The maximum number of results to return. (Optional)
  * @param	integer	$page	The page of results to return. (Optional)
  * @return	PaginatedResult	A PaginatedResult object.
  * @see		PaginatedResult
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getPastEvents($venue, $limit = null, $page = null)
 {
     $xml = CallerFactory::getDefaultCaller()->call('venue.getPastEvents', array('venue' => $venue, 'limit' => $limit, 'page' => $page));
     $events = array();
     foreach ($xml->children() as $event) {
         $events[] = Event::fromSimpleXMLElement($event);
     }
     $perPage = Util::toInteger($xml['perPage']);
     return new PaginatedResult(Util::toInteger($xml['total']), (Util::toInteger($xml['page']) - 1) * $perPage, $perPage, $events);
 }
Example #5
0
 /** Get a list of upcoming events for this artist. Easily integratable into calendars, using the ical standard (see feeds section below).
  *
  * @param	string	$artist	The artist name in question. (Required)
  * @return	array			An array of Event objects.
  * @see		Event
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getEvents($artist)
 {
     $xml = CallerFactory::getDefaultCaller()->call('artist.getEvents', array('artist' => $artist));
     $events = array();
     foreach ($xml->children() as $event) {
         $events[] = Event::fromSimpleXMLElement($event);
     }
     return $events;
 }