about summary refs log tree commit diff stats
path: root/superstack.php
diff options
context:
space:
mode:
Diffstat (limited to 'superstack.php')
-rw-r--r--superstack.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/superstack.php b/superstack.php index 8f8b2a0..306b7b3 100644 --- a/superstack.php +++ b/superstack.php
@@ -1,11 +1,18 @@
1<?php 1<?php
2$site = urldecode($_GET['page']); 2$site = $_GET['page'];
3 3
4if(!empty($site) && !preg_match("substack\.com", $site)) { 4if (empty($site)) {
5 http_response_code(403); 5 echo "Superstack!\n";
6 exit 6 return;
7} 7}
8 8
9if (! preg_match('/substack\.com/', $site)) {
10 echo "Requires a substack URL!";
11 return;
12}
13
14$site = urldecode($site);
15
9$ch = curl_init($site); 16$ch = curl_init($site);
10curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 17curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
11$page = curl_exec($ch); 18$page = curl_exec($ch);
@@ -53,3 +60,4 @@ foreach ($content as $el) {
53 60
54 </body> 61 </body>
55 </html> 62 </html>
63