Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
1{% macro get_backlinks(subject, source, dids, limit) %} 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" /> <button type="submit">get links</button></pre> 10 </form> 11 <script> 12 const addDidButton = document.getElementById('add-did'); 13 const didPlaceholder = document.getElementById('did-placeholder'); 14 addDidButton.addEventListener('click', e => { 15 e.preventDefault(); 16 const i = document.createElement('input'); 17 i.placeholder = 'did:plc:...'; 18 i.name = "did" 19 const p = addDidButton.parentNode; 20 p.insertBefore(document.createTextNode('&did= '), didPlaceholder); 21 p.insertBefore(i, didPlaceholder); 22 p.insertBefore(document.createTextNode('\n '), didPlaceholder); 23 }); 24 </script> 25{% endmacro %} 26 27{% macro get_many_to_many_counts(subject, source, pathToOther, dids, otherSubjects, limit) %} 28 <form method="get" action="/xrpc/blue.microcosm.links.getManyToManyCounts"> 29 <pre class="code"><strong>GET</strong> /xrpc/blue.microcosm.links.getManyToManyCounts 30 ?subject= <input type="text" name="subject" value="{{ subject }}" placeholder="at-uri, did, uri..." /> 31 &source= <input type="text" name="source" value="{{ source }}" placeholder="app.bsky.feed.like:subject.uri" /> 32 &pathToOther= <input type="text" name="pathToOther" value="{{ pathToOther }}" placeholder="otherThing.uri" /> 33 {%- for did in dids %}{% if !did.is_empty() %} 34 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 35 <span id="m2m-subject-placeholder"></span> <button id="m2m-add-subject">+ other subject filter</button> 36 {%- for otherSubject in otherSubjects %}{% if !otherSubject.is_empty() %} 37 &otherSubject= <input type="text" name="did" value="{{ otherSubject }}" placeholder="at-uri, did, uri..." />{% endif %}{% endfor %} 38 <span id="m2m-did-placeholder"></span> <button id="m2m-add-did">+ did filter</button> 39 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get links</button></pre> 40 </form> 41 <script> 42 const m2mAddDidButton = document.getElementById('m2m-add-did'); 43 const m2mDidPlaceholder = document.getElementById('m2m-did-placeholder'); 44 m2mAddDidButton.addEventListener('click', e => { 45 e.preventDefault(); 46 const i = document.createElement('input'); 47 i.placeholder = 'did:plc:...'; 48 i.name = "did" 49 const p = m2mAddDidButton.parentNode; 50 p.insertBefore(document.createTextNode('&did= '), m2mDidPlaceholder); 51 p.insertBefore(i, m2mDidPlaceholder); 52 p.insertBefore(document.createTextNode('\n '), m2mDidPlaceholder); 53 }); 54 const m2mAddSubjectButton = document.getElementById('m2m-add-subject'); 55 const m2mSubjectPlaceholder = document.getElementById('m2m-subject-placeholder'); 56 m2mAddSubjectButton.addEventListener('click', e => { 57 e.preventDefault(); 58 const i = document.createElement('input'); 59 i.placeholder = 'at-uri, did, uri...'; 60 i.name = "otherSubject" 61 const p = m2mAddSubjectButton.parentNode; 62 p.insertBefore(document.createTextNode('&otherSubject= '), m2mSubjectPlaceholder); 63 p.insertBefore(i, m2mSubjectPlaceholder); 64 p.insertBefore(document.createTextNode('\n '), m2mSubjectPlaceholder); 65 }); 66 </script> 67{% endmacro %} 68 69{% macro links(target, collection, path, dids, limit) %} 70 <form method="get" action="/links"> 71 <pre class="code"><strong>GET</strong> /links 72 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 73 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 74 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> 75 {%- for did in dids %}{% if !did.is_empty() %} 76 &did= <input type="text" name="did" value="{{ did }}" placeholder="did:plc:..." />{% endif %}{% endfor %} 77 <span id="did-placeholder"></span> <button id="add-did">+ did filter</button> 78 &limit= <input type="number" name="limit" value="{{ limit }}" max="100" placeholder="100" /> <button type="submit">get links</button></pre> 79 </form> 80 <script> 81 const addDidButton = document.getElementById('add-did'); 82 const didPlaceholder = document.getElementById('did-placeholder'); 83 addDidButton.addEventListener('click', e => { 84 e.preventDefault(); 85 const i = document.createElement('input'); 86 i.placeholder = 'did:plc:...'; 87 i.name = "did" 88 const p = addDidButton.parentNode; 89 p.insertBefore(document.createTextNode('&did= '), didPlaceholder); 90 p.insertBefore(i, didPlaceholder); 91 p.insertBefore(document.createTextNode('\n '), didPlaceholder); 92 }); 93 </script> 94{% endmacro %} 95 96{% macro dids(target, collection, path) %} 97 <form method="get" action="/links/distinct-dids"> 98 <pre class="code"><strong>GET</strong> /links/distinct-dids 99 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 100 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 101 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links</button></pre> 102 </form> 103{% endmacro %} 104 105 106{% macro links_count(target, collection, path) %} 107 <form method="get" action="/links/count"> 108<pre class="code"><strong>GET</strong> /links/count 109 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 110 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 111 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links count</button></pre> 112 </form> 113{% endmacro %} 114 115 116{% macro dids_count(target, collection, path) %} 117 <form method="get" action="/links/count/distinct-dids"> 118<pre class="code"><strong>GET</strong> /links/count/distinct-dids 119 ?target= <input type="text" name="target" value="{{ target }}" placeholder="target" /> 120 &collection= <input type="text" name="collection" value="{{ collection }}" placeholder="collection" /> 121 &path= <input type="text" name="path" value="{{ path }}" placeholder="path" /> <button type="submit">get links count</button></pre> 122 </form> 123{% endmacro %} 124 125 126{% macro links_all_count(target) %} 127 <form method="get" action="/links/all/count"> 128 <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> 129 </form> 130{% endmacro %} 131 132 133{% macro explore_links(target) %} 134 <form method="get" action="/links/all"> 135 <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> 136 </form> 137{% endmacro %}