Image may be NSFW.
Clik here to view.
Feedburner Abone Sayısını Metin olarak Göstermek adlı yazımıza ek olarak Google Feed Abone Sayısını Metin olarak Göstermek adlı bir yazıyı da gerekli buldum.
Feedburner için Gerekli olan Eski Kod
Aşağıdaki kod Feedburner için, birazdan Google Feed’e uyumlu hale getirmek için ekleme yapacağız.
//get cool feedburner count $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rsskitap"; //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $whaturl); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; //end get cool feedburner count
Google Feed için Çözüm
Aşağıdaki satır:2 ‘yi düzenleyeceğiz
//get cool feedburner count $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rsskitap";
Üzerine yapıştıracağımız kod;
//get cool feedburner count $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=rsskitap";
Sonuç
Sonuç olarak kodumuz aşağıdaki hali aldı.
//get cool feedburner count $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=rsskitap"; //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $whaturl); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; //end get cool feedburner count
İşe Yaramazsa
- rsskitap yazan yerleri kendi feedburner kimliğinizle değiştirdiniz mi?
http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburner-id
ilehttps://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id
arasındaki farkı oluşturduğunuzdan emin olun.- SimpleXMLElement PHP5 gerektirir. Eğer sitenizi barındıran hosting firması PHP4 kullanıyorsa yükseltmeleri için iletişime geçmelisiniz