Skip to content

Hacker News Scraper simple Ruby program that scrapes news entries from Hacker News and provides functionality for filtering the results.

License

Notifications You must be signed in to change notification settings

stefanomarch/hacker-news-scraper

Repository files navigation

Hacker News Scraper

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

Requirements

  • Ruby 3.2.2 or higher

Installation

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

Usage

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

Scrape without filters

This option will scrape the first 30 news entries from the Hacker News homepage and display them in the terminal.

Apply filters

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

Tests

To run the test suite execute the following command:

bundle exec rspec

Test Style with Rubocop:

bundle exec rubocop

Design Decisions

You can find a detailed description of the design decisions I made while building this application in the DESIGN_DECISIONS.md file.

About

Hacker News Scraper simple Ruby program that scrapes news entries from Hacker News and provides functionality for filtering the results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages