/
grabcontent.html
executable file
·71 lines (70 loc) · 3.38 KB
/
grabcontent.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Prototype wiki-to-ebook</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link href="assets/css/style.css" rel="stylesheet" />
</head>
<body>
<h2>Wiki API</h2>
<div id="parameters">
<h3>Project</h3>
<p>Define the Wiki Project.</p>
<input type="text" id="w-proj" placeholder="http://en.wikipedia.org" value="http://en.wikipedia.org">
<h3>Page Title</h3>
<p>Type the page title (exactly as it appears in the page)</p>
<input type="text" id="w-page" placeholder="The page title (Etherpad)" value="Etherpad">
<h3>Action</h3>
<p>Choose the action you'd like the query to perform.</p>
<select id="w-action">
<option value="parse">parse</option>
<option value="query">query</option>
<!-- Different query actions demand different parameters to be sent along with the query. This script is optimized for the parse action. -->
</select>
<h3>Properties</h3>
<p>Choose which properties you'd like to include.</p>
<!-- the values displayed here should match the w-action selected above -->
<select id="w-prop" multiple>
<option value="text">Text</option>
<option value="langlinks">Language Links</option>
<option value="categories">Categories</option>
<option value="categorieshtml">Categories in html version</option>
<option value="links">Links</option>
<option value="templates">Templates</option>
<option value="externallinks">External links</option>
<option value="sections">Sections</option>
<option value="revid">Revidion ID</option>
<option value="displaytitle">Title of parsed wiki text</option>
<option value="iwlinks">Interwiki links</option>
</select>
<!-- retrieved from https://en.wikipedia.org/w/api.php?action=help&modules=parse -->
<select id="w-parse-prop" multiple>
<option value="text">Text</option>
<option value="langlinks">Language Links</option>
<option value="categories">Categories</option>
<option value="categorieshtml">Categories in html version</option>
<option value="links">Links</option>
<option value="templates">Templates</option>
<option value="externallinks">External links</option>
<option value="sections">Sections</option>
<option value="revid">Revision ID</option>
<option value="displaytitle">Title of parsed wiki text</option>
<option value="iwlinks">Interwiki links</option>
</select>
<select id="w-query-prop" multiple>
<option value="images">Images</option>
<option value="contributors">Contributors</option>
<option value="references">References</option>
</select>
<button id="query">Send Query</button>
</div>
<div id="result">
<h3>Result</h3>
<p id="string"></p>
<pre id="page">Result will be displayed here.</pre>
<pre id="interpretation"> the interpretation of JSON </pre>
</div>
<script src="assets/js/grabcontent.js" ></script>
</body>
</html>