Getting tweets into a topic via Discourse API

AI-generated summary

In a Dev category discussion titled ‘Getting tweets into a topic via Discourse API’, SebastianADW is building a Twitter bot as a Discourse plugin using the Twitter gem, and seeks guidance on using the Discourse API to post crawled tweets as replies to a topic every 10 seconds. They also ask if there’s a cleaner way to manage gem dependencies in plugin.rb and whether they can display the last crawled tweet (e.g., tweets.to_a.last.full_text) on the server for testing. Federico_Tomassetti expresses interest in the reverse direction — tweeting every new Discourse topic. merefield suggests reviewing a related Meta Discourse thread about webhooks for new topics only, which may offer relevant insights.

I am trying to create a kind of twitter bot as a discourse plugin.
I already managed to crawl tweets with the twitter gem (BTW. i had to require tons of gems in the plugin.rb with gem 'gemname', '0.4.2', {require: false} to get it working, is there a cleaner way to do it?)

But now i want to send those tweets in a discourse topic. Lets say, the plugin checks every 10 seconds if there is a new tweet, and if so it creates a new reply to the topic.
I am not really sure how to use the Discourse API to achieve that.

What i am also curious about would be to get it managed to just get any kind of input on my discourse server via api - Would really appreciate if someone could help me there.
And: My tweets are at the moment as a hash map in a variable tweets. Can i display the variable in any way on my discourse server just for testing purposes?
For example show tweets.to_a.last.full_text and then somewhere the last crawled tweet is showing up?

I would like to go the opposite: tweeting every topic

take a look at: