Shows how to get repo export and walk it in TypeScript walktherepo.wisp.place

pics and stuff

.tangled/images/apiWalk.jpg

This is a binary file and will not be displayed.

.tangled/images/carWalk.jpg

This is a binary file and will not be displayed.

+2 -1
index.html
··· 2 2 <html lang="en"> 3 3 <head> 4 4 <meta charset="UTF-8" /> 5 - <link rel="icon" type="image/svg+xml" href="/vite.svg" /> 5 + <link rel="icon" type="image/svg+xml" href="/dude.png" /> 6 6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 7 7 <title>Repo Walking</title> 8 8 <meta name="description" content="Walk the repo, count the steps."> 9 9 <meta name="og:description" content="Walk the repo, count the steps."> 10 + 10 11 </head> 11 12 <body> 12 13 <div id="app"></div>
-6
pnpm-lock.yaml
··· 11 11 '@atcute/atproto': 12 12 specifier: ^3.1.10 13 13 version: 3.1.10 14 - '@atcute/car': 15 - specifier: ^5.0.0 16 - version: 5.0.0 17 - '@atcute/cbor': 18 - specifier: ^2.2.8 19 - version: 2.2.8 20 14 '@atcute/client': 21 15 specifier: ^4.2.1 22 16 version: 4.2.1
public/dude.png

This is a binary file and will not be displayed.

public/slowPoke.png

This is a binary file and will not be displayed.

-1
public/vite.svg
··· 1 - <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
-1
src/App.svelte
··· 29 29 <h1>Repo Walk Example</h1> 30 30 <br> 31 31 <p>Demo showing why you may rather export the users whole repo instead of walking it via api calls</p> 32 - 33 32 <sub>Also shows how many records you have and how many of each kind if you're into that kind of thing...</sub> 34 33 {/if} 35 34 <div class="card">
-1
src/assets/svelte.svg
··· 1 - <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
+5 -5
src/lib/RepoStats.svelte
··· 1 1 <script lang="ts"> 2 - import { fromStream } from '@atcute/repo'; 3 2 import { onMount } from 'svelte'; 4 3 import { Client, simpleFetchHandler } from '@atcute/client'; 5 4 import type {} from '@atcute/atproto'; ··· 68 67 } 69 68 70 69 const { readable, writable } = repoEntryTransform(); 70 + //Don't want to await so we can read as it streams 71 71 result.data.pipeTo(writable); 72 - // let stream = result.data; 73 - // const car = fromStream(stream); 74 72 75 73 try { 76 74 //This reads the repo as it is downloaded. which was very cool and I didn't know it would do that 77 75 for await (const entry of readable) { 76 + // record here is the content of the atproto record 77 + // console.log(entry.record); 78 78 let checkForCollection = collections.find(c => c.collection === entry.collection); 79 79 if (!checkForCollection) { 80 80 collections.push({ collection: entry.collection, count: 1 }); ··· 188 188 <div> 189 189 {#if slowPokeMode} 190 190 <img alt="A Shellder biting a Slowpoke's tail, as seen in the Pokémon anime " 191 - src="https://upload.wikimedia.org/wikipedia/en/a/a2/Slowpoke_and_Shellder.jpg"> 191 + src="/slowPoke.png"> 192 192 <br> 193 193 {:else} 194 - <img alt="text in a speech bubble that says 'Dude, wheres my car'" src="https://canvas-lb.tubitv.com/opts/vONU3oa-F26tCQ==/461d4328-59c2-4dcd-9601-fa749fea4b92/CJcDELQBOgUxLjEuOEAB"> 194 + <img alt="text in a speech bubble that says 'Dude, wheres my car'" src="/dude.png"> 195 195 <br> 196 196 {/if} 197 197
+2 -2
src/lib/SearchForm.svelte
··· 46 46 47 47 const didDoc = await didResolver.resolve(did); 48 48 const pdsUrl = getPdsEndpoint(didDoc); 49 - 49 + 50 50 resolvedResult(did, pdsUrl, slowpoke); 51 51 }catch(e){ 52 52 if (e instanceof Error) { ··· 61 61 <form onsubmit={searchForUser}> 62 62 <label for="search">ATProto Handle</label> 63 63 <input bind:value={handleToLookUp} id="search" type="text" placeholder="alice.bsky.social"/> 64 - <button>Lookup</button> 64 + <button>walk by {slowpoke ? 'api calls' : 'repo export'}</button> 65 65 <br> 66 66 <label> 67 67 <input bind:checked={slowpoke} type="checkbox"/>