Jump to content

Search the Community

Showing results for tags 'Itunes'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 2 results

  1. Manny

    Parse iTunes RSS

    I'm currently working on a project which involves iTunes RSS feeds. For example, this is the RSS feed for the current top 10 singles in the UK iTunes store https://itunes.apple.com/gb/rss/topsongs/limit=10/explicit=true/xml Taking a look at the code, here is an example entry from that feed: <entry> <updated>2013-08-09T09:23:18-07:00</updated> <id im:id="667931604">https://itunes.apple.com/gb/album/wake-me-up/id667931602?i=667931604&uo=2</id>'>https://itunes.apple.com/gb/album/wake-me-up/id667931602?i=667931604&uo=2</id> <title>Wake Me Up - Avicii</title> <im:name>Wake Me Up</im:name> <link rel="alternate" type="text/html" href="https://itunes.apple.com/gb/album/wake-me-up/id667931602?i=667931604&uo=2"/> <im:contentType term="Music" label="Music"><im:contentType term="Track" label="Track"/></im:contentType> <category im:id="17" term="Dance" scheme="https://itunes.apple.com/gb/genre/music-dance/id17?uo=2" label="Dance"/> <link title="Preview" rel="enclosure" type="audio/x-m4a" href="http://a1130.phobos.apple.com/us/r2000/010/Music6/v4/c2/d7/c8/c2d7c88d-9c72-fe8b-bf15-6339bd0d2ed7/mzaf_7989860748510150629.plus.aac.p.m4a" im:assetType="preview"><im:duration>30000</im:duration></link> <im:artist href="https://itunes.apple.com/gb/artist/avicii/id298496035?uo=2">Avicii</im:artist> <im:price amount="0.99000" currency="GBP">£0.99</im:price> <im:image height="55">http://a1697.phobos.apple.com/us/r2000/019/Music6/v4/41/45/93/4145934f-b7b9-76e1-f190-05b50a4588e1/13UAAIM09848.55x55-70.jpg</im:image> <im:image height="60">http://a419.phobos.apple.com/us/r2000/019/Music6/v4/41/45/93/4145934f-b7b9-76e1-f190-05b50a4588e1/13UAAIM09848.60x60-50.jpg</im:image> <im:image height="170">http://a1266.phobos.apple.com/us/r2000/019/Music6/v4/41/45/93/4145934f-b7b9-76e1-f190-05b50a4588e1/13UAAIM09848.170x170-75.jpg</im:image> <rights>℗ 2013 Avicii Music AB, under exclusive license to Universal Music AB</rights> <im:releaseDate label="25 June 2013">2013-06-25T00:00:00-07:00</im:releaseDate></entry> Having followed some advice from elsewhere - http://stackoverflow.com/questions/9965370/parse-itunes-rss-atom-feed-with-php - I have managed to get hold of all data, with the exception of one thing. Frm the line below, I need to be able to get the value of 'im:id' (i.e. 667931604) <id im:id="667931604">https://itunes.apple.com/gb/album/wake-me-up/id667931602?i=667931604&uo=2</id>'>https://itunes.apple.com/gb/album/wake-me-up/id667931602?i=667931604&uo=2</id> Here's the code I have so far: $itunes_xml = file_get_contents('https://itunes.apple.com/gb/rss/topsongs/limit=10/explicit=true/xml');// Remove the colon ":" in the <xxx:yyy> to be <xxxyyy>$itunes_xml = preg_replace("/(</?)(w+)[^>]*>)/", "$1$2$3", $itunes_xml);$itunes_xml = simplexml_load_string($itunes_xml);foreach ($itunes_xml->entry as $entry) { echo $entry->id['im:id']; // This doesn't work echo $entry->imprice['amount']; // This works} To me, it looks like the colon in 'im:id' is breaking the script. I'm aware of the preg_replace function that has been used, so maybe that is causing the issue, but if I remove it then I'm unable to retrieve other elements of the feed. Is anybody aware of a fix for this? I'd appreciate any help.
  2. Morning to you Master of Java Programming. My name is King Amada, with basic knowledge of HTML and Javascript. I want to Create a javascript button, that onclick it will open itunes and play music, i am using Mac OSX 10.8.2, and have safari browser to test my website. and i want to validate my form, i want the user not be able to submit the form without filling in all the fields, and selecting the platform, and last but not least, i want if the user select wimac, to open another music file, if wimob to open another one, please help me out. this is my code below, help me out please? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""]http://www.w3.org/TR...nsitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Untitled Document</title><style type="text/css">#apDiv1 {position: absolute;width: 200px;height: 331px;z-index: 1;left: 189px;top: 121px;font-style: oblique;font-weight: lighter;color: #999;background-image: url(../../Downloads/back_to_the_mac.jpg.png);}#apDiv2 {position: absolute;width: 200px;height: 56px;z-index: 2;font-size: 18px;left: 0px;top: 82px;}</style><script type="text/javascript">function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == '');} }</script></head><body background="../../Downloads/back_to_the_mac.jpg.png"><div id="apDiv1"> <table width="200" height="331" border="0"> <form id="form1" name="form1" method="get" action="../../Movies/Music Videos/Michael Jackson - Dirty Diana - YouTube.FLV"> <tr> <th width="107" scope="col" align="left">WiName:</th> <th width="77" scope="col"> <label for="WName"></label> <input type="text" name="WName" id="WName" tabindex="1" size="15"/> </th> </tr> <tr> <th scope="row" align="left">WiKey:</th> <td><label for="Wkey"></label> <input type="Password" name="Wkey" id="Wkey" tabindex="2" size="15" /></td> </tr> <tr> <th scope="row"> </th> <td><div id="apDiv2" align="center"><hr />Platform<hr /></div></td> </tr> <tr> <th scope="row" align="left">WiMob:</th> <td><input type="radio" name="radio" id="Mob" value="Mob" tabindex="3" /> <label for="Mob"></label></td> </tr> <tr> <th scope="row" align="left">WiWin:</th> <td><input type="radio" name="radio" id="Win" value="Win" tabindex="4" /> <label for="Win"></label></td> </tr> <tr> <th scope="row" align="left">WiMac:</th> <td><input type="radio" name="radio" id="Mac" value="Mac" tabindex="5" /> <label for="Mac"></label></td> </tr> <tr> <th scope="row"> </th> <td><input name="Submit" type="submit" id="Submit" tabindex="6" onclick="MM_validateForm('WName','','R','Wkey','','R');return document.MM_returnValue" value="Submit" /></td> </tr> </form> </table></div></body></html> Read more: http://forum.codecall.net/topic/73719-javascript-programming-to-play-open-and-play-itunes-music-in-itunes/#ixzz2GZDwc46I
  • Create New...