Skip to content

This project is a Telegram bot focused on technology news built with ruby

License

Notifications You must be signed in to change notification settings

gscarv13/twixo-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twixo - The Technology News Bot

demo

Twixo is a Telegram bot that can give you updates on the top latest technology news from Techcrunch, TheNextWeb, The Verge, Techradar, and Wired.

Built With

  • Ruby
  • Telegram Bot API
  • News API
  • RSpec
  • Rubocop

Getting Started

Get Twixo

  • Visit here to start using Twixo

Run Your Bot Locally

  • 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

Interact With The Bot

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

Running RSpec

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.

Authors

👤 Gustavo Carvalho

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to leave your suggestion on the issues page.

Show your support

Give an ⭐️ if you like this project!

📝 License

This project is MIT licensed.

About

This project is a Telegram bot focused on technology news built with ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages