Adding extra Repositories on Ubuntu


Repositories on Ubuntu are the locations that you can download software from. As a general rule, the default repositories don’t contain the right locations for most software packages that you’ll want to install. You will want to open up the /etc/apt/sources.list file, find and uncomment the following lines deb http://us.archive.ubuntu.com/ubuntu dapper universe main restricted universe deb … Continue reading Adding extra Repositories on Ubuntu

Using Yahoo Weather API to get weather conditions in CakePHP2


// import XML class App::uses('Xml', 'Utility'); // your XML file's location /*w is the code of the city, and u is the unit of temperature (c/f) $xml = Xml::build('http://weather.yahooapis.com/forecastrss?w=615702&u=c'); $xml should contain the following data, where you can extract whatever you want from it SimpleXMLElement Object ( [@attributes] => Array ( [version] => 2.0 ) … Continue reading Using Yahoo Weather API to get weather conditions in CakePHP2

Parsing XML easily in CakePHP 2


It is very easy to parse XML in CakePHP , here is an example in CakePHP v2 // import XML Utility class App::uses('Xml', 'Utility'); // your XML file's location $xml1 = Xml::build('http://url-of-XML'); $xml2 = Xml::build('http://http://url-of-XML', array('return' => 'simplexml')); // $xml now is a instance of SimpleXMLElement // New method using DOMDocument $xml3 = Xml::build('http://url-of-XML', array('return' … Continue reading Parsing XML easily in CakePHP 2