List/Grid

Tag Archives: curl

Read feed XML feed using simplexml and curl

Using simplexml: $xml = "path_of_xml"; $ch = simplexml_load_file($xml); foreach ($ch->channel->item as $item) { echo "$item->title–$item->description"; <br> } This displays you all the titles and their description of the xml Using… Read more »

Create a TinyURL with PHP

//gets the data from a URL function get_tiny_url($url) { $ch = curl_init(); $timeout = 5; //Depend on you curl_setopt($ch,CURLOPT_URL,’http://tinyurl.com/api-create.php?url=’.$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $newUr = curl_exec($ch); curl_close($ch); return $newUr; } //test it… Read more »

Using twitter API using Curl PHP

I came across a problem of how to send my wordpress post directly to twitter using Curl, and after my several tries i found this solution. You can use this… Read more »