Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Posts tagged ‘delicious’

Kenar

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

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 ;)

Kenar

cURL & php ile delicious’a otomatik yazı gönderme

delicious_logo

Daha önce curl ile twitter'a post atma işlemini incelemiştik şimdide sıra geldi delicious'a :)

PHP:
  1. $dusername = 'KullaniciAdi';
  2. $dpassword = 'Sifre';
  3. $link = urlencode('$yaziLinki');
  4. $desc = urlencode($yazi_baslik);
  5. $ext = urlencode($yazi_aciklama);
  6. $deltags = urlencode($yazi_etiket);
  7.  
  8. $api = "api.del.icio.us/v1";
  9.  
  10. $apicall = "https://$dusername:$dpassword@$api/posts/add?&amp;url=$link&amp;description=$desc&amp;extended=$ext&amp;tags=$deltags";
  11. $ch = curl_init();
  12. curl_setopt($ch, CURLOPT_URL,$apicall);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  14. curl_setopt($ch, CURLOPT_USERAGENT, 'php-curl');
  15. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  16. $xml = curl_exec ($ch);
  17. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  18. curl_close($ch);
  19. if ($httpcode != 200) {
  20. echo "<strong>Delicious</strong> HATA";
  21. } else {
  22. echo "<strong>Delicious</strong> OK";
  23. }