From edf9c1f1e75a6f7b13f5207caf0cafdc2d94f7f3 Mon Sep 17 00:00:00 2001 From: Albirew Date: Tue, 13 Oct 2020 15:46:26 +0200 Subject: [PATCH] Create coto.php added very simple proxy page in case it's usefull (or to bypass corp proxy to read a page without needing pics/css/scripts) --- coto.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 coto.php diff --git a/coto.php b/coto.php new file mode 100644 index 0000000..dfa3124 --- /dev/null +++ b/coto.php @@ -0,0 +1,74 @@ + a créé ce fichier. Tant que vous conservez cet avertissement, + * vous pouvez faire ce que vous voulez de ce truc. Si on se rencontre un jour et + * que vous pensez que ce truc vaut le coup, vous pouvez me payer une bière en + * retour. + * ---------------------------------------------------------------------------- + */ +function better_file_get_content($url) +{ + $user_agent='Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0'; + $options = array( + CURLOPT_CUSTOMREQUEST =>"GET", + CURLOPT_POST =>false, + CURLOPT_USERAGENT => $user_agent, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HEADER => false, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_ENCODING => "", + CURLOPT_AUTOREFERER => true, + CURLOPT_SSL_VERIFYPEER => 0, + CURLOPT_CONNECTTIMEOUT => 120, + CURLOPT_TIMEOUT => 120, + CURLOPT_MAXREDIRS => 10, + ); + $ch = curl_init( $url ); + curl_setopt_array( $ch, $options ); + $content = curl_exec( $ch ); + $err = curl_errno( $ch ); + $errmsg = curl_error( $ch ); + $header = curl_getinfo( $ch ); + curl_close( $ch ); + $header['errno'] = $err; + $header['errmsg'] = $errmsg; + $header['content'] = $content; + return $header; +} + +if(isset($_GET['rss'])) +{ + $rss = $_GET['rss']; + if(!preg_match('/http[s]?:\/\//', $rss, $matches)) $rss = 'http://'.$rss; + header("Pragma: no-cache"); + echo $rss; +} +else +{ + echo ' + + + + proxy RSS + + + + +
+

Proxy RSS

+

rev.2

Mode d`emploi: Mettez l`URL complète du flux RSS que vous voulez, puis cliquez sur GO!.

+
+ + +
+
+
+
+ Albirew - code source +
+ +'; +} +?> \ No newline at end of file