Hacker News Scraper is a simple Ruby program that scrapes news entries from Hacker News and provides functionality for filtering the results.
hacker_news_scaper.mov
- Ruby 3.2.2 or higher
Clone this repository and run the following command to install dependencies:
git clone https://github.com/stefanomarch/hacker-news-scraper.git
Move into the project directory:
cd hacker-news-scraper
Install dependencies:
bundle install
Make the script executable:
chmod +x bin/hacker_news_scraper
To run the program simply execute the following command:
./bin/hacker_news_scraper
This will display the following menu:
HackerNews Scraper
1. Scrape without filters
2. Apply filters
3. Exit
This option will scrape the first 30 news entries from the Hacker News homepage and display them in the terminal.
This option will display the following menu:
Filter Options:
1. Filter entries with more than five words in the title ordered by the number of comments first.
2. Filter entries with less than or equal to five words in the title ordered by points
3. Exit
To run the test suite execute the following command:
bundle exec rspec
Test Style with Rubocop:
bundle exec rubocop
You can find a detailed description of the design decisions I made while building this application in the DESIGN_DECISIONS.md file.