This project is the Capstone Solo project for the Ruby section of the Microverse curriculum. It utilizes various helpful gems like Nokogiri, geocoder, and easy-translate to scrap Google Trends XML page for the latest trends for a given country.
- Once you download the project, please make sure that you have Ruby installed.
- Make sure to run the
bundle
command in the terminal once you are in the working directory - You'll also have to set up a Google API key if you need the translation feature as mentioned below You should be good to go after verifying the above details 😄
Some of the features of this project include:
-
Scraping Google trends XML for information
-
Ability to change Country and Information limit
-
Resetting values to default
-
Translation of other languages to English if any (Requires Google Cloud API Key)
-
Suggesting locations and prompting user based on country change input
-
This project utilizes the Ruby programming language
-
Ruby Gems:
- gem 'geocoder'
- gem 'nokogiri'
- gem 'rest-client'
- gem 'os'
- gem 'easy_translate'
- gem 'dotenv'
To be able to use the translation feature on one's system, you'll have to do the following:
- Gain access to the Translation API Key (More Info)
- Place the key iside
.env_sample
file - Rename the
.env_sample
file to.env
On the first run, the program produces the following output:
$ ruby bin/main.rb
"Please choose your option:"
"1. Show Daily Trends from the United States"
"2. Show Trends from a different country"
"3. Change Number of Trends to Show"
"4. Reset country and number of trend"
"5 or 'q' to Quit"
On requesting a change in the country, the output is as follows:
2
"Please enter the country name"
Jeju
"Did you mean South Korea? (y/n)"
Once the program gets a confirmation, the program proceeds as:
"Country changed to South Korea!"
"Please choose your option:"
"1. Show Daily Trends from South Korea"
"2. Show Trends from a different country"
"3. Change Number of Trends to Show"
"4. Reset country and number of trend"
"5 or 'q' to Quit"
Thus creating a loop until the user quits
- Moin Khan
- LinkedIn : @MoinKhanIF
- Personal Website: MoinKhanIF.dev
- Twitter: @MoinKhanIF