-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathform.php
104 lines (84 loc) · 3.7 KB
/
form.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!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 Parser (PHP)
<?= $version ?>
</h1>
<form action="<?= $PATH ?>" accept-charset="UTF-8" method="get">
<div class="form-group">
<label for="url">Enter a URL</label>
<input id="url" class="form-control form-control-lg" type="url" name="url" />
</div>
<button type="submit" class="btn btn-lg btn-success">Parse</button>
</form>
<h2 class="h4 my-5">Parse a snippet of HTML</h2>
<form method="post" action="<?= $PATH ?>" class="mb-5">
<div class="form-group">
<label for="html">HTML</label>
<textarea id="html" name="html" rows="6" class="form-control form-control-lg"></textarea>
</div>
<div class="form-group">
<label for="base-url">Base URL</label>
<input id="base-url" name="url" type="url" class="form-control form-control-lg" />
</div>
<div class="form-check">
<label class="form-check-label" for="save">
<input id="save" name="save" class="form-check-input" type="checkbox" value="1">
Save HTML? <span class="help">(Note: Data older than <?= $EXPIRE_HOURS ?> hours may be purged)</span>
</label>
</div>
<div class="form-check">
<label class="form-check-label" for="show_html">
<input id="show_html" name="show_html" class="form-check-input" type="checkbox" value="1">
Render HTML in page?
</label>
</div>
<button type="submit" class="btn btn-lg btn-success">Parse</button>
</form>
<h2 class="h4 my-5" id="json">Validate MF2 JSON</h2>
<form method="post" action="<?= $PATH ?>" class="mb-5">
<div class="form-group">
<label for="json">JSON</label>
<textarea id="json-input" name="json" rows="6" class="form-control form-control-lg"></textarea>
</div>
<div class="form-group">
<select name="input-type" class="form-control">
<option value="list">List of items (full mf2 parsed result)</option>
<option value="single">Single mf2 object</option>
</select>
</div>
<button type="submit" class="btn btn-lg btn-success">Validate</button>
</form>
<hr>
<p>
Drag this link to your bookmarks toolbar to parse a page with one click!<br>
</p>
<a class="btn btn-primary btn-sm" href="javascript:(function(){if(document.location.hostname=='pin13.net'&&document.location.pathname=='/mf2/'){document.location.href=decodeURIComponent(document.location.search.slice(5))}else{%20document.location.href='https://pin13.net/mf2/?url='+encodeURIComponent(document.location.href);}}())">mf2 parser</a>
<hr>
<footer class="my-5">
<ul>
<li><a href="https://microformats.io">About Microformats</a></li>
<li><a href="https://github.com/indieweb/microformats-parser-website-php">Source code for this site</a></li>
<li><a href="https://github.com/microformats/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>