Copy url from one site to another - $25

Discussion in 'JavaScript' started by dennisbrittv, Jan 21, 2011.

  1. #1
    i have an xml playlist on one of my sites: www.mollymalonesseafood.co.uk/play/playlist.xml

    Within that play list is a dynamic url (tho may not change as in test mode) beginning with 22.222.222

    what i need is the URL 22.222.222 or what ever may replace it, to be placed in a page of my choice on page load.

    so... i have
    <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="THIS IS BLANK" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed>                  
     </div>
    Code (markup):
    i need:

    <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="the url from the xml goes here" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed>                  
     </div>
    Code (markup):
    simply:

    Take the url ://22.222.222 etc an put it in the player every time the page loads


    Please assist

    I nevere read the rules but i can and will give a few bucks if im allowed to
     
    dennisbrittv, Jan 21, 2011 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try this script:

    
    $xml = simplexml_load_file("http://www.mollymalonesseafood.co.uk/play/playlist.xml");
    
    $player = '<div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="%s" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed></div>';
    
    printf($player,$xml->url);
    
    PHP:
     
    s_ruben, Jan 21, 2011 IP
  3. dennisbrittv

    dennisbrittv Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No chance mate, i need that url out of the xml!!
     
    dennisbrittv, Jan 22, 2011 IP
  4. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm sure I posted this earlier but I can't find the thread. :confused: Anyway, here it is again:
    
    <html>
    <head>
    <script type="text/javascript">
    function loadVideo() {
    	var vidurl, xmldoc, xmlhttp;
    	if (window.XMLHttpRequest) {
    	  xmlhttp = new XMLHttpRequest(); // code for IE7+, Firefox, Chrome, Opera, Safari
    	} else {
    	  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
    	}
    	xmlhttp.open("GET", "http://www.mollymalonesseafood.co.uk/play/playlist.xml", false);
    	xmlhttp.send();
    	xmldoc = xmlhttp.responseXML; 
    	vidurl = xmldoc.getElementsByTagName("url")[0].childNodes[0].nodeValue;
    	document.getElementById("player").childNodes[0].setAttribute("target", vidurl);
    }
    </script>
    </head>
    <body onload="loadVideo()">
    <div id="player"><embed pluginspace="WhackSlackPlugin.html" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" target="" autoplay="true" autoloop="true" volume="25" width="900" height="500"></embed></div>
    </body>
    </html>
    
    Code (markup):
    Only works if the domains are the same because of the same domain policy used by browsers.
     
    Cash Nebula, Jan 22, 2011 IP
  5. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #5
    Do you mean this:

    
    $xml = simplexml_load_file("http://www.mollymalonesseafood.co.uk/play/playlist.xml");
    
    echo($xml->url);
    
    PHP:
     
    s_ruben, Jan 22, 2011 IP