Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
at main 184 lines 11 kB view raw
1{% macro get_backlinks(subject, source, dids, limit, reverse) %} 2 <form method="get" action="/xrpc/blue.microcosm.links.getBacklinks"> 3 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinks 4 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> 5 &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject.uri" /> 6 {%- for did in dids %}{% if !did.is_empty() %} 7 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 8 <span id="did-placeholder"></span> <button id="add-did">+ did filter</button> 9 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> 10 &reverse= <input type="checkbox" name="reverse" value="true" {% if reverse %}checked{% endif %}> 11 <button type="submit">get links</button></pre> 12 </form> 13 <script> 14 const addDidButton = document.getElementById('add-did'); 15 const didPlaceholder = document.getElementById('did-placeholder'); 16 addDidButton.addEventListener('click', e => { 17 e.preventDefault(); 18 const i = document.createElement('input'); 19 i.placeholder = 'did:plc:...'; 20 i.name = "did" 21 const p = addDidButton.parentNode; 22 p.insertBefore(document.createTextNode('&did= '), didPlaceholder); 23 p.insertBefore(i, didPlaceholder); 24 p.insertBefore(document.createTextNode('\n '), didPlaceholder); 25 }); 26 </script> 27{% endmacro %} 28 29{% macro get_many_to_many_counts(subject, source, pathToOther, dids, otherSubjects, limit) %} 30 <form method="get" action="/xrpc/blue.microcosm.links.getManyToManyCounts"> 31 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getManyToManyCounts 32 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> 33 &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject.uri" /> 34 &pathToOther= <input type="text" name="pathToOther" value="{{ pathToOther }}" placeholder="otherThing.uri" /> 35 {%- for did in dids %}{% if !did.is_empty() %} 36 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 37 <span id="m2m-subject-placeholder"></span> <button id="m2m-add-subject">+ other subject filter</button> 38 {%- for otherSubject in otherSubjects %}{% if !otherSubject.is_empty() %} 39 &otherSubject= <input type="text" name="did" value="{{ otherSubject }}" placeholder="at-uri, did, uri..." />{% endif %}{% endfor %} 40 <span id="m2m-did-placeholder"></span> <button id="m2m-add-did">+ did filter</button> 41 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get links</button></pre> 42 </form> 43 <script> 44 const m2mAddDidButton = document.getElementById('m2m-add-did'); 45 const m2mDidPlaceholder = document.getElementById('m2m-did-placeholder'); 46 m2mAddDidButton.addEventListener('click', e => { 47 e.preventDefault(); 48 const i = document.createElement('input'); 49 i.placeholder = 'did:plc:...'; 50 i.name = "did" 51 const p = m2mAddDidButton.parentNode; 52 p.insertBefore(document.createTextNode('&did= '), m2mDidPlaceholder); 53 p.insertBefore(i, m2mDidPlaceholder); 54 p.insertBefore(document.createTextNode('\n '), m2mDidPlaceholder); 55 }); 56 const m2mAddSubjectButton = document.getElementById('m2m-add-subject'); 57 const m2mSubjectPlaceholder = document.getElementById('m2m-subject-placeholder'); 58 m2mAddSubjectButton.addEventListener('click', e => { 59 e.preventDefault(); 60 const i = document.createElement('input'); 61 i.placeholder = 'at-uri, did, uri...'; 62 i.name = "otherSubject" 63 const p = m2mAddSubjectButton.parentNode; 64 p.insertBefore(document.createTextNode('&otherSubject= '), m2mSubjectPlaceholder); 65 p.insertBefore(i, m2mSubjectPlaceholder); 66 p.insertBefore(document.createTextNode('\n '), m2mSubjectPlaceholder); 67 }); 68 </script> 69{% endmacro %} 70 71{% macro get_many_to_many(subject, source, pathToOther, dids, otherSubjects, limit) %} 72 <form method="get" action="/xrpc/blue.microcosm.links.getManyToMany"> 73 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getManyToMany 74 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> 75 &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject" /> 76 &pathToOther= <input type="text" name="pathToOther" value="{{ pathToOther }}" placeholder="otherThing" /> 77 {%- for did in dids %}{% if !did.is_empty() %} 78 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 79 <span id="m2m-did-placeholder"></span> <button id="m2m-add-did">+ did filter</button> 80 {%- for otherSubject in otherSubjects %}{% if !otherSubject.is_empty() %} 81 &otherSubject= <input type="text" name="otherSubject" value="{{ otherSubject }}" placeholder="at-uri, did, uri..." />{% endif %}{% endfor %} 82 <span id="m2m-other-placeholder"></span> <button id="m2m-add-other">+ other subject filter</button> 83 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get many-to-many links</button></pre> 84 </form> 85 <script> 86 const m2mAddDidButton = document.getElementById('m2m-add-did'); 87 const m2mDidPlaceholder = document.getElementById('m2m-did-placeholder'); 88 m2mAddDidButton.addEventListener('click', e => { 89 e.preventDefault(); 90 const i = document.createElement('input'); 91 i.placeholder = 'did:plc:...'; 92 i.name = "did" 93 const p = m2mAddDidButton.parentNode; 94 p.insertBefore(document.createTextNode('&did= '), m2mDidPlaceholder); 95 p.insertBefore(i, m2mDidPlaceholder); 96 p.insertBefore(document.createTextNode('\n '), m2mDidPlaceholder); 97 }); 98 </script> 99{% endmacro %} 100 101{% macro links(target, collection, path, dids, limit) %} 102 <form method="get" action="/links"> 103 <pre class="code"><strong>GET</strong> /links 104 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 105 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 106 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> 107 {%- for did in dids %}{% if !did.is_empty() %} 108 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 109 <span id="did-placeholder"></span> <button id="add-did">+ did filter</button> 110 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get links</button></pre> 111 </form> 112 <script> 113 const addDidButton = document.getElementById('add-did'); 114 const didPlaceholder = document.getElementById('did-placeholder'); 115 addDidButton.addEventListener('click', e => { 116 e.preventDefault(); 117 const i = document.createElement('input'); 118 i.placeholder = 'did:plc:...'; 119 i.name = "did" 120 const p = addDidButton.parentNode; 121 p.insertBefore(document.createTextNode('&did= '), didPlaceholder); 122 p.insertBefore(i, didPlaceholder); 123 p.insertBefore(document.createTextNode('\n '), didPlaceholder); 124 }); 125 </script> 126{% endmacro %} 127 128{% macro dids(target, collection, path) %} 129 <form method="get" action="/links/distinct-dids"> 130 <pre class="code"><strong>GET</strong> /links/distinct-dids 131 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 132 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 133 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links</button></pre> 134 </form> 135{% endmacro %} 136 137{% macro get_backlinks_count(subject, source) %} 138 <form method="get" action="/xrpc/blue.microcosm.links.getBacklinksCount"> 139 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinksCount 140 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 141 &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> <button type="submit">get links count</button></pre> 142 </form> 143{% endmacro %} 144 145{% macro get_backlink_dids(subject, source) %} 146 <form method="get" action="/xrpc/blue.microcosm.links.getBacklinkDids"> 147 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getBacklinkDids 148 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="subject" /> 149 &source= <input type="text" name="source" value="{{ source }}" placeholder="source" /> <button type="submit">get links</button></pre> 150 </form> 151{% endmacro %} 152 153{% macro links_count(target, collection, path) %} 154 <form method="get" action="/links/count"> 155<pre class="code"><strong>GET</strong> /links/count 156 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 157 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 158 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links count</button></pre> 159 </form> 160{% endmacro %} 161 162 163{% macro dids_count(target, collection, path) %} 164 <form method="get" action="/links/count/distinct-dids"> 165<pre class="code"><strong>GET</strong> /links/count/distinct-dids 166 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 167 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 168 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links count</button></pre> 169 </form> 170{% endmacro %} 171 172 173{% macro links_all_count(target) %} 174 <form method="get" action="/links/all/count"> 175 <pre class="code"><strong>GET</strong> /links/all/count?target=<input type="text" name="target" value="{{ target }}" placeholder="target" /> <button type="submit">get all target link counts</button></pre> 176 </form> 177{% endmacro %} 178 179 180{% macro explore_links(target) %} 181 <form method="get" action="/links/all"> 182 <pre class="code"><strong>GET</strong> /links/all?target=<input type="text" name="target" value="{{ target }}" placeholder="target" /> <button type="submit">get all target link counts</button></pre> 183 </form> 184{% endmacro %}