diff --git a/packages/api/Dockerfile b/packages/api/Dockerfile index d5271fbfb..ec19ab524 100644 --- a/packages/api/Dockerfile +++ b/packages/api/Dockerfile @@ -47,6 +47,7 @@ COPY --from=builder /app/packages/api/node_modules /app/packages/api/node_module COPY --from=builder /app/node_modules /app/node_modules COPY --from=builder /app/package.json /app/package.json COPY --from=builder /app/packages/text-to-speech/ /app/packages/text-to-speech/ +COPY --from=builder /app/packages/content-handler/ /app/packages/content-handler/ EXPOSE 8080 CMD ["yarn", "workspace", "@omnivore/api", "start"] diff --git a/packages/content-handler/src/websites/twitter-handler.ts b/packages/content-handler/src/websites/twitter-handler.ts index 108d5785f..1249461bf 100644 --- a/packages/content-handler/src/websites/twitter-handler.ts +++ b/packages/content-handler/src/websites/twitter-handler.ts @@ -37,7 +37,7 @@ interface TweetData { type: string id: string }[] - conversation_id: number + conversation_id: string attachments?: { media_keys: string[] } @@ -74,7 +74,7 @@ const getTweetFields = () => { // unroll recent tweet thread const getTweetThread = async ( - id: string, + conversationId: string, username: string ): Promise => { const BASE_ENDPOINT = 'https://api.twitter.com/2/tweets/search/recent' @@ -82,7 +82,7 @@ const getTweetThread = async ( BASE_ENDPOINT + '?query=' + encodeURIComponent( - `conversation_id:${id} from:${username} to:${username}` + `conversation_id:${conversationId} from:${username} to:${username}` ) + getTweetFields() + '&max_results=100' @@ -160,7 +160,10 @@ export class TwitterHandler extends ContentHandler { const tweets = [tweet] // check if tweet is a thread - const thread = await getTweetThread(tweetId, author.username) + const thread = await getTweetThread( + tweetData.conversation_id, + author.username + ) if (thread.meta.result_count > 0) { // tweets are in reverse chronological order in the thread for (const t of thread.data.reverse()) {