Nick's Archiving Tweet Tutorial
This is an open discussion with 10 replies, filed under General.
Search
You could try to load it “the normal way”:
$symphony_feed = new DOMDocument(); if($symphony_feed->load($page)) { $symphony_tweets = $symphony_feed->getElementsByTagName("entry"); ... } else { die("Loading the XML file failed!"); }
Blank page even though I have display errors on…
I got it, will post solution this weekend.
Thanks Lewis. Sorry I didn’t get a chance to reply to this thread or tweet. Let me know and I’ll add it as an addendum on my blog post.
I have allow_url_fopen
disabled for security which will cause DOMDocument::load()
to fail. Must use CURL
and DOMDocument::loadXML()
instead. For example:
$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $page); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5); $rsp = curl_exec($ch); curl_close($ch); $data = strstr($rsp, '<?'); // Get the most recent cached tweets from Symphony $symphony_feed = DOMDocument::loadXML($data);
I still think this feature should be in the core. A CMS that speaks and thinks in XML should defenitely be able to understand and save foreign XML (and I don’t mean dynamic XML datasources).
@phoque: For sure. Some data-merge-y function would rock. Nick Dunn and I had been throwing that idea about for a while but nothing has come of it as yet.
I’ve played with Rowan’s Import Manager to change its workflow somewhat. The plan is for it to be a one-stop-shop for importing XML into Symphony: mapping an XML feed onto Symphony sections, sanitising content through custom functions, and an ability to set up a cron too.
Nick Dunn and I had been throwing that idea about for a while but nothing has come of it as yet.
Perhaps because I haven’t found time to be on IRC since before the summer: apologies. We should do it.
A (more or less) universal importer would be great, especially for “switchers”.
A (more or less) universal importer would be great, especially for “switchers”.
…and for Symphony old timers who are still managing sites running on version 1.7 and earlier. I’ve got sites I want to upgrade and I’d willingly pay for this functionality (or build it myself when I have time to figure it out - I was actually starting to see if I could figure it out over the weekend).
Create an account or sign in to comment.
DOM is enabled but it appears to be the root of the problem. No warning or fatal error is displayed unless I delete everything after:
at which point it throws:
I’m having trouble finding the exact problem. Any ideas?
http://nick-dunn.co.uk/article/archiving-xml-with-symphony/