-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcopydata.php
More file actions
38 lines (26 loc) · 721 Bytes
/
copydata.php
File metadata and controls
38 lines (26 loc) · 721 Bytes
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
<?php
$dnaurl = "https://raw.githubusercontent.com/LafeLabs/thing/master/data/dna.txt";
if(isset($_GET["from"])){
$fromurl = $_GET["from"];
$dnaurl = $fromurl."/data/dna.txt";
}
$baseurl = explode("data/",$dnaurl)[0];
$dnaraw = file_get_contents($dnaurl);
$dna = json_decode($dnaraw);
//copy($baseurl."data/currentMap.txt","data/currentMap.txt");
foreach($dna->maps as $value){
copy($baseurl."maps/".$value,"maps/".$value);
}
foreach($dna->scrolls as $value){
copy($baseurl."scrolls/".$value,"scrolls/".$value);
}
foreach($dna->data as $value){
copy($baseurl."data/".$value,"data/".$value);
}
?>
<a href = "index.html">CLICK TO GO TO MAIN PAGE</a>
<style>
a{
font-size:3em;
}
</style>