How to embed Twitter's "List of Tweets Corresponding to Search Results" into React

Asked 2 years ago, Updated 2 years ago, 59 views

Thank you for your help.
I would like to embed a list of tweets corresponding to Twitter's search results in React as comfortable as possible. Does anyone know a good way?

As an image of the behavior, we expect that when we search for hoge on Twitter, the search results corresponding to https://twitter.com/search?q=hoge will be drawn.
A similar feature allows you to obtain a specific account or timeline tied to an id by using a React library called react-twitter-embed.It looks good and easy to use, but the function of displaying search results is not supported.It is possible to obtain tweets corresponding to the search results by using Twitter API, but it is only possible to obtain text, so it takes time and effort to mold the appearance.Given that react-twitter-embed can easily embed non-textual information such as the Like button, I think there is a way to embed it well without molding it yourself.

I would appreciate it if you could let me know if anyone knows a good way.
Thank you for your cooperation.

html css reactjs api twitter

2022-09-30 17:50

1 Answers

TwitterTimelineEmbed in react-twitter-embed uses Twitter-provided embedded scripts, specifically https://publish.twitter.com, which can be found at widgets.js.On the other hand, widgets.js does not support searching for any string.Abolished in 2018.

Therefore, as far as I know, the direct attack method should be to use the API to bring the search results and display them yourself...


2022-09-30 17:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.