0

Basically the user will create a comment that can contain a link to a twitter timeline, the code will capture the link and embed that user's timeline in the comments list. I was able to dynamically embed posts, but that's because the twitter api doesn't ask for any authorization to return post data: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post- and-engage/api-reference/get-statuses-oembed

But with the timeline it's another matter, they ask for authorization(https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline), which I don't have.

I can't just do it here:

<a className="twitter-timeline" data-height="800" href="https://twitter.com/${userName}">
      
</a>

Because the code will be generated dynamically.

Does anyone have a solution? In this case, it doesn't even have to be the timeline, it can just be the last tweet of the user, but I don't have publication status information, only the name of the user that will come through the link in the comment, for example: https:// twitter.com/Doublelift1

1
  • If you are using React why is there an issue of generating the HTML (JSX) dynamically? In the component that renders the JSX, pass as a prop the dynamic data that you need Jul 19, 2022 at 1:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.