diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-02-20 16:34:46 +0100 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-02-20 16:34:46 +0100 |
| commit | 6ba43ae9df43722d747cb5a422f7a2471849b079 (patch) | |
| tree | d15519ec6b8f9ec436f8433332e84c6108fe85bf | |
| parent | fb11d8099e44f0e02f71d46b807dcab9c890eac8 (diff) | |
| download | llostre-6ba43ae9df43722d747cb5a422f7a2471849b079.tar.xz llostre-6ba43ae9df43722d747cb5a422f7a2471849b079.zip | |
cleanup
| -rw-r--r-- | backend/fetchers/profiles.go | 3 | ||||
| -rw-r--r-- | frontend/src/main.ts | 24 |
2 files changed, 11 insertions, 16 deletions
diff --git a/backend/fetchers/profiles.go b/backend/fetchers/profiles.go index c25dd97..9a1334a 100644 --- a/backend/fetchers/profiles.go +++ b/backend/fetchers/profiles.go @@ -47,13 +47,11 @@ func FetchHandle(did string) (string, error) { func FetchProfile(did string, pdsURL string) (*general.Profile, error) { recordURL := fmt.Sprintf("%s/xrpc/com.atproto.repo.getRecord?repo=%s&collection=app.bsky.actor.profile&rkey=self", pdsURL, did) - fmt.Printf("Fetching profile from: %s\n", recordURL) resp, err := http.Get(recordURL) if err != nil { return nil, err } defer resp.Body.Close() - fmt.Printf("Response status: %d\n", resp.StatusCode) if resp.StatusCode != 200 { return nil, fmt.Errorf("profile fetch failed: %d", resp.StatusCode) @@ -75,7 +73,6 @@ func FetchProfile(did string, pdsURL string) (*general.Profile, error) { if err != nil { return nil, err } - fmt.Printf("Unmarshaled value: %+v\n", response.Value) var avatarURL, bannerURL string if response.Value.Avatar != nil { diff --git a/frontend/src/main.ts b/frontend/src/main.ts index dbf791b..20c3bea 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -36,7 +36,7 @@ function renderTextWithFacets(text: string, facets: any[]): string { case 'tag': result += `<a href="https://bsky.app/hashtag/${facet.value}" target="_blank">#${facetText}</a>`; break; - default: // in case Bluesky ever adds other fcaet types + default: // in case Bluesky ever adds other facet types result += facetText; // if we don't recognize the type, just add it as plain text break; } @@ -48,8 +48,6 @@ function renderTextWithFacets(text: string, facets: any[]): string { const remainingBytes = postBytes.slice(lastPos); result += decoder.decode(remainingBytes); - console.log(result); - return result; } @@ -82,25 +80,25 @@ async function main() { const response = await fetch('http://localhost:8080/api/posts'); if (!response.ok) throw new Error(`HTTP ${response.status}`); - const posts = await response.json(); + const notes = await response.json(); app.innerHTML = ''; - for (const post of posts) { + for (const note of notes) { let parsedText = ''; - if(post.facets && post.facets.length > 0) { - parsedText = renderTextWithFacets(post.text || '', post.facets || []); + if(note.facets && note.facets.length > 0) { + parsedText = renderTextWithFacets(note.text || '', note.facets || []); } else { - parsedText = post.text; + parsedText = note.text; } - const postText = marked.parseInline(parsedText, { breaks: true }); + const noteText = marked.parseInline(parsedText, { breaks: true }); const postHTML = ` <div class="note"> - <img class="note-avatar" src="${post.avatarURL}" alt="avatar"> + <img class="note-avatar" src="${note.avatarURL}" alt="avatar"> <div class="note-content"> - ${renderAuthor(post)} - <div class="note-text">${postText}</div> - <div class="muted">${new Date(post.createdAt).toLocaleString()}</div> + ${renderAuthor(note)} + <div class="note-text">${noteText}</div> + <div class="muted">${new Date(note.createdAt).toLocaleString()}</div> </div> </div> `; |
