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

 Kodlama       

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?&url=$link&description=$desc&extended=$ext&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. }

Sayfa 1 - 11
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
CrossBlock designed by DeltaManual.Com  |  In conjunction with Web Hosting   |   Web Hosting   |   Reverse phone