You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.2 KiB
26 lines
1.2 KiB
<?php
|
|
|
|
class WpGdprExtension extends Minz_Extension {
|
|
public function init() {
|
|
$this->registerHook('simplepie_before_init', array('WpGdprExtension', 'curlHook'));
|
|
}
|
|
|
|
public static function curlHook($simplePie, $feed) {
|
|
#if (preg_match('#^https?://[a-zA-Z]*.washingtonpost.com/#i', $feed->url())) {
|
|
# $simplePie->set_curl_options(array(CURLOPT_HTTPHEADER => "X-Forwarded-For: 91.132.137.222"));
|
|
#}
|
|
if (preg_match('#^https?://[a-zA-Z]*.washingtonpost.com/#i', $feed->url())) {
|
|
$simplePie->set_curl_options(array(CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,CURLOPT_PROXY => "192.168.5.27:1081"));
|
|
}
|
|
if (preg_match('#^https?://ddl-warez.to/#i', $feed->url())) {
|
|
$simplePie->set_curl_options(array(CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,CURLOPT_PROXY => "192.168.5.28:1081"));
|
|
}
|
|
if (preg_match('#^https?://[a-zA-Z]*.movie-blog.org/#i', $feed->url())) {
|
|
$simplePie->set_curl_options(array(CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,CURLOPT_PROXY => "192.168.5.28:1081"));
|
|
}
|
|
if (preg_match('#^https?://ddl-music.to/#i', $feed->url())) {
|
|
$simplePie->set_curl_options(array(CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,CURLOPT_PROXY => "192.168.5.28:1081"));
|
|
}
|
|
}
|
|
}
|
|
|