fork download
  1. <?php
  2.  
  3. if (function_exists('curl_version')) {
  4. echo "cURL is enabled!";
  5. } else {
  6. echo "cURL is not enabled.";
  7. }
  8.  
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_URL, "https://w...content-available-to-author-only...d.com/mp/rss_mp.jsp");
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  12. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
  13. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  14.  
  15. $response = curl_exec($ch);
  16. $error = curl_error($ch);
  17.  
  18. if ($response === false) {
  19. die("cURL Error: " . $error);
  20. }
  21.  
  22. $rss_feed = simplexml_load_string($response);
  23.  
  24. if ($rss_feed === false) {
  25. die("Invalid RSS feed format.");
  26. }
  27.  
  28. foreach ($rss_feed->channel->item as $item) {
  29. echo "Title: " . $item->title . "<br>";
  30. echo "Description: " . $item->description . "<br>";
  31. echo "Date: " . $item->pubDate . "<br><br>";
  32. }
  33.  
  34. ?>
  35.  
Success #stdin #stdout 0.03s 26344KB
stdin
Standard input is empty
stdout
cURL is enabled!cURL Error: Could not resolve host: www.cooksongold.com