Your new favorite way to get today's top headlines!
What's Happening is a CLI application that allows the user to search today's top news headlines by category, receive a random headline, link to the web to read full articles, and even save and remove articles from your favorites list.
Dive in and find out What's Happening today!
- Ruby - version 2.6.1
- ActiveRecord - version 6.0
- Sinatra - version 2.0
- Sinatra-activerecord - version 2.0
- SQLite3 - version 1.4
- JSON - version 2.3
- Rest-Client - version 2.1
- TTY-Font - version 0.5.0
- Colorize - version 0.8.1
To try out this project:
- Open an account with https://newsapi.org/
- Clone the GitHub repository locally to your computer
- In the command line, navigate to the root directory of this repository, and enter the following: $ bundle install $ touch .env
- Navigate to the .env folder, and paste in the following: export API_KEY=YOUR_API_KEY_HERE (e.g. export API_KEY=15151515)
- In the command of the root directory of the project folder, run: $ rake db:migrate
- Now save all files, on Windows: (start + alt + s), on Macs: (command + alt +s)
- Run the following code in the command line while being in the most root folder of this project:
ruby runner.rbdef welcome
font = TTY::Font.new(:doom)
puts font.write("What's Happening?")
puts "Hello! What is your name?".colorize(:yellow)
$user_name = gets.strip
$user = User.create(name: $user_name)
Cli.choose_category
end def self.top_five(stories, category)
puts "Here are today's top 5 #{category} stories:".colorize(:yellow)
counter = 1
result = stories["articles"].take(5).each do |key, value|
puts "#{counter}. " + "#{key["title"]}"
counter += 1
end - Full CRUD application
- Browse today's top headlines by category
- Receive a random headline
- See more info on any headline (title, summary, link)
- Click on a link to open up the full article on the web
- Add articles to your favorites list
- Remove articles from your favorates list
Project is: finished with option to expand functionality and DRY out code.
The inspiration for What's Happening came from our desire to quickly and easily see what's going on in the world today. We set out to build an application that would be fun, interactive, and highly practical. We hope you find using What's Happening as enjoyable and helpful as we do!
Created by Tony Kim and Matt Long
Feel free to contact us!