-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
101 lines (88 loc) · 4.19 KB
/
index.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>git-nostr</title>
<script src="https://unpkg.com/nostr-tools/lib/nostr.bundle.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.*/css/pico.min.css">
<meta name="lightning" content="lnurlp:[email protected]"/>
<meta property="og:image" content="https://nostrin.gs/git-nostr.png" />
</head>
<body>
<main class="container">
<h1>git-nostr - reports</h1>
<h5>git-nostr is a command line tool to enhance git (clone of git-ssb)</h5>
<p></p>
lightning address: [email protected]
<p></p>
<small>examples below are all derived from git-nostr generated "other stuff"</small>
<p></p><p></p>
<details>
<summary>issues</summary>
<pre id="issues"></pre>
</details>
<details>
<summary>commits with content</summary>
<pre id="commitswithcontent"></pre>
</details>
<details>
<summary>patch content</summary>
<pre id="patchcontent"></pre>
</details>
<details>
<summary>commits without content</summary>
<pre id="commitswithoutcontent"></pre>
</details>
<details>
<summary>raw clones</summary>
<pre id="rawclones"></pre>
</details>
<details>
<summary>names</summary>
<pre id="names"></pre>
</details>
<details>
<summary>authors</summary>
<pre id="authors"></pre>
</details>
<details>
<summary>raw events</summary>
<pre id="rawevents"></pre>
</details>
<section id="star" data-theme="light" aria-label="Star git-nostr on GitHub"><div class="container"><p>Give us a Star on GitHub:<iframe src="https://ghbtns.com/github-btn.html?user=colealbon&repo=git-nostr&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160" height="30" title="GitHub"></iframe></p></div></section>
<script>
const pool = new window.NostrTools.SimplePool()
const relays = ['wss://nostr.nostrin.gs', 'wss://relay.damus.io/', 'wss://relay.orangepill.dev']
const events = []
let sub = pool.sub(
[...relays],
[
{"kinds": [7777]}
]
)
sub.on('event', event => {
events.push(event)
document.getElementById("rawevents").innerHTML = JSON.stringify(events, null, 2)
const issues = [...new Set(events.filter((event) => event.tags.flat().find((tag => tag === 'git-nostr-issue')))
.map(issue => issue.tags.filter(issuetag => issuetag.indexOf('title') !== -1))
.flat(Infinity).filter(issueEntry => issueEntry !== 'title'))]
document.getElementById("issues").innerHTML = JSON.stringify(issues, null, 2)
const clones = events.filter((event) => event.tags.flat().find((tag => tag === 'git-nostr-clone')))
document.getElementById("rawclones").innerHTML = JSON.stringify(clones, null, 2)
const commitsWithContent = events.filter((event) => event.tags.flat().find((tag => tag === 'commitid')))
document.getElementById("commitswithcontent").innerHTML = JSON.stringify(commitsWithContent, null, 2)
const patchContent = commitsWithContent.map(commitevent => atob(commitevent.content))
document.getElementById("patchcontent").innerText = patchContent
const commitsWithoutContent = events.filter((event) => event.tags.flat().find((tag => tag === 'git-nostr-publish')))
document.getElementById("commitswithoutcontent").innerHTML = JSON.stringify(commitsWithoutContent, null, 2)
const names = events.filter((event) => event.tags.flat().find((tag => tag === 'git-nostr-name')))
document.getElementById("names").innerHTML = JSON.stringify(names, null, 2)
const authors = [...new Set(events.filter((event) => event.tags.flat().find((tag => tag === 'commitid')))
.map(publishevent => atob(publishevent.content).split('\n')[1].split(':')[1].trim()))]
document.getElementById("authors").innerHTML = JSON.stringify(authors, null, 2)
})
</script>
</main>
</body>
</html>