Twixo is a Telegram bot that can give you updates on the top latest technology news from Techcrunch, TheNextWeb, The Verge, Techradar, and Wired.
- Ruby
- Telegram Bot API
- News API
- RSpec
- Rubocop
- Visit here to start using Twixo
-
Install ruby language on your machine here
-
Create a Telegram account here
-
Create a Telegram bot here Click on 'Send Message' and enter
/start
, then/newbot
and follow the instructions -
Save the Token, it will be used in the next steps.
-
Create an account at newsapi.org and save the API key.
-
Use
git clone https://github.com/gscarv13/twixo-bot.git
-
Move to the directory where the project was cloned to.
-
Install the dependencies with
$ bundle install
- Open the
lib/news.rb
file and change the line 9:
NEWS_API = 'ADD_NEWS_API_KEY_HERE'
- Open the
lib/bot.rb
file and change the line 8:
@token = 'ADD_BOT_TOKEN_HERE'
Alternatively, it is possible to add both the NEWS_API
and BOT_TOKEN
to an environment variable
file using the dotenv
gem.
- Create a
token.env
file - Add the following lines
BOT='ADD_BOT_TOKEN_HERE'
SOURCE='ADD_NEWS_API_KEY_HERE'
- Open the
lib/news.rb
file and change the line 9 to:
NEWS_API = ENV['SOURCE']
- Open the
lib/bot.rb
file and change the line 8 to:
@token = ENV['BOT']
- Finally, run your bot from the root directory with the command
$ ruby bin/main.rb
Once the bot is running you can type /start
to see the bot options.
Enter one of the source options and the bot will send the top news on the chat
First, Install RSpec with gem command in the terminal
$ gem install rspec
Or install with bundle (Gemfile already included)
$ bundle install
To run the tests will be necessary to add your NEWS_API
to the lib/news.rb
file
or to the .env
file as mentioned above
- Enter
rspec
from the root directory.
👤 Gustavo Carvalho
- GitHub: @gscarv13
- Twitter: @Gscarv13
- LinkedIn: Gustavo Carvalho
Contributions, issues, and feature requests are welcome!
Feel free to leave your suggestion on the issues page.
Give an ⭐️ if you like this project!
This project is MIT licensed.