Jump to content

Search the Community

Showing results for tags 'xmlapi'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Not sure if I am putting this in the right thread. I am new to xml and working with api's. I am working on a songkick api script. All of it is working correctly except I can't get the id. I have tried multiple things and none of them worked sadly. $artist_id = $_GET['id']; $api_key = "##########################"; $request_url = "http://api.songkick.com/api/3.0/artists/" . $artist_id . "/calendar.xml?apikey=" . $api_key; $xml = simplexml_load_file($request_url); foreach ($xml->results->event as $event) { $skdate = $event->start["date"]; $date = date("M d, Y", strtotime($skdate)); $id = $event->id; //what I can't get working $venue = $event->venue["displayName"]; $city = $event->location["city"]; $street = $event->location["street"]; $zipcode = $event->location["zipcode"]; $phone = $event->location["phone"]; $website = $event->location["website"]; $capacity = $event->location["capacity"]; $description = $event->location["description"]; $artists = $event->xpath("./performance/artist/@displayName"); echo "<a href=\"details.php?id=$id\" class=\"show_events\"> <span id=\"date\">$date</span> <span id=\"header\">$venue</span> $city<br>"; echo implode(', ',$artists); echo "</a>"; } Songkick API repsonse: { "resultsPage": { "results": { "event": [ { "id":11129128, "type":"Concert", "uri":"http://www.songkick.com/concerts/11129128-wild-flag-at-fillmore?utm_source=PARTNER_ID&utm_medium=partner", "displayName":"Wild Flag at The Fillmore (April 18, 2012)", "start":{"time":"20:00:00", "date":"2012-04-18", "datetime":"2012-04-18T20:00:00-0800"}, "performance":[{"artist":{"uri":"http://www.songkick.com/artists/29835-wild-flag?utm_source=PARTNER_ID&utm_medium=partner", "displayName":"Wild Flag","id":29835,"identifier":[]}, "displayName":"Wild Flag", "billingIndex":1, "id":21579303, "billing":"headline"}], "location":{"city":"San Francisco, CA, US","lng":-122.4332937,"lat":37.7842398}, "venue":{"id":6239, "displayName":"The Fillmore", "uri":"http://www.songkick.com/venues/6239-fillmore?utm_source=PARTNER_ID&utm_medium=partner", "lng":-122.4332937, "lat":37.7842398, "metroArea":{"uri":"http://www.songkick.com/metro_areas/26330-us-sf-bay-area?utm_source=PARTNER_ID&utm_medium=partner", "displayName":"SF Bay Area","country":{"displayName":"US"},"id":26330,"state":{"displayName":"CA"}}}, "status":"ok", "popularity":0.012763 }, .... ]}, "totalEntries":24, "perPage":50, "page":1, "status":"ok" } } I would just like to know how to get the id working - it is just left blank.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.