// Tem 4th, 2010 // Wordpress Geliştirme

Google Feed Abone Sayısını Metin olarak Göstermek

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 ile https://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

İlginizi Çekebilir

Kategoriler Arşiv Son Yorumlar Linkler Sayfalar
 

Tweetlemeden olmaz diyenlere! @rssems


Yorum yap, fikrini paylaş

Buraya sizin reklamınızı koyalım! ((:RSS @ Galata Kulesi, İstanbulRSS: Hellö kaplumbağa yavrusu! @ Balıkesir.RSS /w @muratsanlisavas @ Sansüre Sansür RSS @ Lojman, BursaRSS @ Haller, Eskişehir | Teşekkürler @Gökhür Arıkboğa :)RSS @ Göksu Parkı, AnkaraRSS @ Likemind BursaRSS @ TEDxRSS @ EskişehirTEDxReset 'What IF?'Buraya sizin reklamınızı koyalım! ((: