# Getting tweets into a topic via Discourse API

**URL:** <https://meta.discourse.org/t/getting-tweets-into-a-topic-via-discourse-api/101172>\
**Category:** Development\
**Created:** [02.Ноябрь.2018 20:45:07 UTC](https://meta.discourse.org/t/getting-tweets-into-a-topic-via-discourse-api/101172 "2018-11-02T20:45:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SebastianADW](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@SebastianADW](https://meta.discourse.org/u/SebastianADW)\
**Post date:** [02.Ноябрь.2018 20:45:08 UTC](https://meta.discourse.org/t/getting-tweets-into-a-topic-via-discourse-api/101172/1 "2018-11-02T20:45:08Z")

</div>

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?

---

_[View the full topic](https://meta.discourse.org/t/getting-tweets-into-a-topic-via-discourse-api/101172)._
