![]() |
Best way to syndicate content between sites?
Hey guys, easy straightforward question.
I need to be able to control a small amount of content on a 3rd party website, but they'd prefer not to give me full access to their servers .. so what's the best way to syndicate this content? Virtual Include? Php? is there something easier that I'm not thinking of? any advise greatly appreciate. thanks, -Phil |
Come on guys, i know someone here has a good solution for me! :thumbsup
-p |
What type of content and how is it formatted on the client end?
Can you just create an XML schema and let them pull it from your servers? |
Quote:
Basically some text links and a few small pics that need to rotate weekly. I need to look into xml, that sounds like a good option but I don't even know where to start with it. Edit: On the client end it becomes part of the normal html-based page layout. Any tips? Thanks! -Phil |
timmmmeh?
|
The only reason I was thinking XML as pretty much any scripting language could grab it from a remote server and parse it however they want - much like how RSS is such a big hit since it's just XML.
Code:
<?xml version="1.0"?> Basically, if you remove the data from the presentation (html), the end user has free reign on how they can display it. Then again, it takes added knowledge to be able to parse it in the first place. |
Quote:
|
Quote:
At first i was just thinking of using a virtual include which i think would be easier, but i just read that virtual includes don't work cross-domain. anyone know if that's true? I gues i just need to try it lol .. Thanks again !! -Phil |
yeah in include maybe an iframe, so many options, you could treat it like a plugin
|
Quote:
Thanks, -Phil |
Quote:
Ahh I forgot about iframes, that is another good option although id prefer to use a regular (non php) include if possible. :thumbsup Thanks! -P |
Great info here guys, any other suggestions?
Thanks again, -Phil |
i like rss:
require_once 'XML/RSS.php; $rss =& new XML_RSS('http://some_domain_here/rss'); $rss->parse(); print_r($rss->getItems()); |
Quote:
I of course have some studying to do, but I can see what you're trying to show me here :) -Phil |
I got bored and hacked a javascript solution together from some web tutorials. No need for PHP or anything.
"sample.xml" file that could be stored on a remote server: Code:
<?xml version="1.0" encoding="ISO-8859-1"?> [html] <html> <head> <title>XML Parser</title> <script language="JavaScript"> var xmlhttp; var output = ""; function loadXMLDoc(url) { // code for Mozilla, etc. if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest() xmlhttp.onreadystatechange=xmlhttpChange xmlhttp.open("GET",url,true) xmlhttp.send(null) } // code for IE else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") if (xmlhttp) { xmlhttp.onreadystatechange=xmlhttpChange xmlhttp.open("GET",url,true) xmlhttp.send() } } } function xmlhttpChange() { // if xmlhttp shows "loaded" if (xmlhttp.readyStatehahahaha4) { // if "OK" if (xmlhttp.statushahahaha200) { xmlObj = xmlhttp.responseXML; parseXML(xmlObj); } else { alert("Problem retrieving XML data") } } } function parseXML(xmlObj) { items = xmlObj.getElementsByTagName("item"); for(i=0;i<items.length;i++) { link = items[i].getElementsByTagName("link")[0].firstChild.nodeValue; text = items[i].getElementsByTagName("text")[0].firstChild.nodeValue; image = items[i].getElementsByTagName("image")[0].firstChild.nodeValue; output += "<p><a href=\"" + link + "\">" + "<img src=\""+image+"\" align=left>" + text + "</a></p><hr/>"; } document.getElementById("targetText").innerHTML = output; } </script> </head> <body onLoad="loadXMLDoc('sample.xml')"> <p>Output from xml document:</p> <div id="targetText"> <!-- output goes here --> </div> </body> [/html] |
holy crap psilli you are the BEST!!! Thank you so much!!! :thumbsup
Fuck yeah buddy :) -P |
All times are GMT -7. The time now is 11:15 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123