Return to Snippet

Revision: 24094
at February 20, 2010 21:15 by alvincrespo


Initial Code
<?php

class xmlmanager{
	
	private $twitterXML;
	private $twitterURL = ""; //insert xml url here
	private $dom;
	
	function __construct(){
	
	}
	
	function GetTwitterXML(){
		
		$this->twitterXML = simplexml_load_file($this->twitterURL);
		
		return ;
		
	}
	
	function save_twitter_xml_as_file(){
		$this->dom = new DOMDocument();
		$this->dom->loadXML($this->twitterXML->asXML());
		$this->dom->saveXML();
		$this->dom->save('mytwitter.xml');
		return ;
	}
	
	function __destruct(){
	
	}
}

?>

Initial URL


Initial Description
This is the beginning of my retrieval of twitter status class...just something im playing with right now. It retrieves the xml, saves it on your server, then you can either use javascript or php to traverse the xml tree.

Initial Title
Retrieve Twitter Status using PHP and XML

Initial Tags
php, xml, twitter

Initial Language
PHP