cURL & php ile FriendFeed’e kayıt giriÅŸi yapmak

Filed in Kodlama 0 Yorum

fflogo friendfeed.com u bilmeyenimiz kalmadı sanırım tekrar açıklamaya gerek yoktur.

Daha önceden delicious ve twitter a curl ile yazı gönderimini işlemiştik.

Şimdide sıra friendfeed'e geldi.

İnternette aradım pek bişi bulamadım deneyerek ortaya çıktı kodlar :)

Friendfeed de daha öncekilerde olduğu gibi direk şifreniz ile işlem yapamıyorsunuz.

https://friendfeed.com/account/api adresinden Remote Key almanız gerekmektedir.

Ve iÅŸte kodlar;

PHP:
  1. $ff_api_url = "http://friendfeed-api.com/v2/entry";
  2. $ff_data = "body=".$Baslik."&link=".$Linkiniz."&comment=".$Yorumu_Aciklama."&image_url=".$ResimVarsaAdresi;
  3. $ff_user = "KullaniciAdiniz";
  4. $ff_password = "AlmisOldugunuzRemoteKey";
  5. $ch = curl_init($ff_api_url);
  6. curl_setopt($ch, CURLOPT_POST, 1);
  7. curl_setopt($ch, CURLOPT_POSTFIELDS, $ff_data);
  8. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9. curl_setopt($ch, CURLOPT_HEADER, 0);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($ch, CURLOPT_USERPWD, "{$ff_user}:{$ff_password}");
  12. $twitter_data = curl_exec($ch);
  13. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  14. curl_close($ch);
  15. if ($httpcode != 200) {
  16.     echo "<strong>Friendfeed</strong> HATA<br />";
  17.     } else {
  18.     echo "<strong>Friendfeed</strong> OK<br />";
  19.     }

güle güle kullanımlar ;)

Posted by Osman ERDOÄžAN   @   11 September 2009 0 Yorum
Etiketler : , , , , , ,

Yazıyı Paylaş

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Previous Post
«
Next Post
»
Luvo designed by Internet Marketing In conjunction with Template Wordpress , R4 DS , Best SUV.