Are you feeling lucky today? Pick a color and let your imagination run wild.
- Ruby, Sinatra, PostgrSQL, DataMapper, HTML, CSS, JavaScript RSpec, Capybara
Note that the Google Custom Search API key has a very low call threshold and you might not find yourself lucky. As an alternative, you can setup this app locally (see next section).
- Clone repository
cd
to the project's root directory- Run
gem install bundler
- Run
bundle install
to install all of the required gems - Create the following databases
feel_lucky_development
andfeel_lucky_test
Go to Custom Search API and click on 'Get a Key' button under the prerequisites section. Make a note of your API Key as you will need it later.
Go to Custom Search Engine and click on Add to create your own custom search engine. You can select 'Search the entire web but emphasise included sites' from the Sites to Search section if you would like to search any Google images. Make a note of your Search engine ID.
In your root directory, create a .env
file and add the following:
API_KEY = YOUR API KEY
CX_ID = YOUR SEARCH ENGINE ID
- Run
rspec
to make sure that all tests are passing - Uncomment the API response on line 26 in the
app.rb
file and remove the stubbed response on line 29. You can use the stubbed response to avoid hitting the API call limit. - Run
rackup
- Visit localhost:9292 in a browser
- Pick a color
- Add a Search again button on
/search
page - Ability to run previous searches