Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created December 15, 2024 13:05
Show Gist options
  • Save YonatanKra/4bae1835df8c88ed63e683db769e995d to your computer and use it in GitHub Desktop.
Save YonatanKra/4bae1835df8c88ed63e683db769e995d to your computer and use it in GitHub Desktop.
#returnPostWithAltlessImages(post: { uri: string; cid: string; value: Record; }) {
const images = post.value?.embed?.images || [];
const imagesWithoutAlt = images.filter(img => !img.alt);
return { post, imagesWithoutAlt };
}
async checkSinglePost(postUri: string) {
try {
const post = await this.#agent.getPost(await parsePostUri(postUri, this.#agent));
return this.#returnPostWithAltlessImages(post);
} catch (e) {
return e;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment