-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjson-result.php
62 lines (50 loc) · 2.16 KB
/
json-result.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>PHP Microformats Parser</title>
<link rel="stylesheet" href="bootstrap-4.0.0.css">
<link rel="stylesheet" href="styles.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<main id="mf2" class="container">
<h1 class="mt-5 mb-3">
Microformats JSON Validator
</h1>
<?php if($error): ?>
<div class="alert alert-danger" role="alert" style="white-space: pre-wrap;"><?php echo htmlspecialchars($error); ?></div>
<?php else: ?>
<div class="alert alert-success" role="alert">Valid Microformats JSON!</div>
<?php endif ?>
<form method="post" action="<?= $PATH ?>" class="mb-5">
<div class="form-group">
<label for="json">JSON</label>
<textarea id="json-input" name="json" rows="30" class="form-control form-control-lg"><?php echo htmlspecialchars($json) ?></textarea>
</div>
<div class="form-group">
<select name="input-type" class="form-control">
<option value="list" <?php echo post('input-type') == 'list' ? 'checked="checked"' : '' ?>>List of items (full mf2 parsed result)</option>
<option value="single" <?php echo post('input-type') == 'single' ? 'checked="checked"' : '' ?>>Single mf2 object</option>
</select>
</div>
<button type="submit" class="btn btn-lg btn-success">Validate</button>
</form>
<footer class="my-5">
<ul>
<li><a href="https://microformats.io">About Microformats</a></li>
<li><a href="https://github.com/aaronpk/mf2-parser-website">Source code for this site</a></li>
<li><a href="https://github.com/indieweb/php-mf2">Source code for the Microformats PHP Parser</a></li>
<li>
Other Microformats Parser websites:
<a href="https://go.microformats.io">Go</a>,
<a href="https://node.microformats.io">Node</a>,
<a href="https://python.microformats.io">Python</a>, and
<a href="https://ruby.microformats.io">Ruby</a>.
</li>
</ul>
</footer>
</main>
</body>
</html>