-
Notifications
You must be signed in to change notification settings - Fork 128
/
plugin.html
29 lines (26 loc) · 857 Bytes
/
plugin.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="https://unpkg.com/spencer-css" />
</head>
<body>
<div class="m4">
client-side plugin demo for <a href="https://github.com/spencermountain/wtf_wikipedia">wtf_wikipedia</a>
</div>
<script src="https://unpkg.com/wtf_wikipedia"></script>
<script src="https://unpkg.com/wtf-plugin-classify"></script>
<script defer>
window.onload = function () {
wtf.plugin(window.wtfClassify)
wtf.fetch('On a Friday', { lang: 'en' }).then((doc) => {
document.querySelector('#result').innerHTML = `
<div >${doc.title()}</div>
<pre >${JSON.stringify(doc.classify(), null, 2)}</pre>
`
})
}
</script>
</body>
</html>