Categories

Category Specific RSS

Get average feedburner reader numbers

function get_average_readers($feed_id,$interval = 7) { $today = date(‘Y-m-d’, strtotime("now")); $ago = date(‘Y-m-d’, strtotime("-".$interval." days")); $feed_url="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=".$feed_id."&dates=".$ago.",".$today; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $feed_url); $data = curl_exec($ch); curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry[‘circulation’];   $nb = 0; foreach($xml->feed->children() as $circ){   $nb += $circ[‘circulation’]; }   return round($nb/$interval); }

[…]

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

Currency conversion

 

function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "http://www.google.com/ig/calculator?hl=en&q=$amount$from_Currency=?$to_Currency"; $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch,  CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)"); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $rawdata = curl_exec($ch); curl_close($ch); $data = explode(‘"’, $rawdata); $data = explode(‘ […]

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

Latest weather using PHP

<?php    $xml = simplexml_load_file(‘http://www.google.com/ig/api?weather=ADDRESS’);   $information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");   echo $information[0]->attributes(); ?>

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare