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