Skip to content

Instantly share code, notes, and snippets.

@abhij89
Created August 12, 2020 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhij89/c7f475cd581e9af9498f4cccf7e2d9f0 to your computer and use it in GitHub Desktop.
Save abhij89/c7f475cd581e9af9498f4cccf7e2d9f0 to your computer and use it in GitHub Desktop.
$feed = new SimplePie();
// Set your proxy
$feed->set_curl_options(
array(
CURLOPT_PROXY => "proxy-url-here",
CURLOPT_PROXYUSERPWD => 'proxy-username-password'
)
);
// Set which feed to process.
$feed->set_feed_url($feedUrl);
// Run SimplePie.
$feed->init();
// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();
$feed->get_items();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment