-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreverse.php
32 lines (25 loc) · 836 Bytes
/
reverse.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/*
if (!isset($_GET['url'])) {
echo "query with ?url=";
die();
}
*/
require __DIR__ . '/vendor/autoload.php';
//$url = $_GET['url'];
//$url = 'http://stream.thatmustbe.us/?url=ben.thatmustbe.me/static/test2.html';
$url = 'http://stream.thatmustbe.us/?url=ben.thatmustbe.me/note/2015/9/16/23/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$js = curl_exec($ch);
//echo($js);
//echo '------------------' . "\n\n";
$mf2 = IndieWeb\socialstream\revert($js);
//echo($mf2);
$mf = Mf2\parse($mf2);
//echo '------------------' . "\n\n";
$result = IndieWeb\socialstream\convert($mf, '', 'en-US', 'http://stream.thatmustbe.us/jf2.php');
echo($result);