Created
August 12, 2020 20:19
-
-
Save abhij89/c7f475cd581e9af9498f4cccf7e2d9f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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