Skip to content

Commit

Permalink
Debug image uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
barryf committed Nov 24, 2024
1 parent f6048e4 commit 4e8fa30
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/events/process-post/syndicate/bluesky.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ async function syndicate (post) {
const url = (typeof photo === 'string') ? photo : photo.value
const alt = (typeof photo === 'string') ? '' : photo.alt
const response = await fetch(url)
if (!response.ok) continue
// if (!response.ok) continue
const arrayBuffer = await response.arrayBuffer()
const buffer = Buffer.from(arrayBuffer)
const { data } = await agent.uploadBlob(
buffer,
{ encoding: 'image/jpeg' })
if (data) {
images.push({
alt,
image: data.blob
})
}
{ encoding: 'image/jpeg' }
)
images.push({
alt,
image: data.blob
})
}
}
if (images.length) {
Expand All @@ -44,6 +43,7 @@ async function syndicate (post) {
images
}
}
console.log('richPost', richPost)

const response = await agent.post(richPost)
if (!response.ok) return
Expand Down

0 comments on commit 4e8fa30

Please sign in to comment.