Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features#2, gets IMDB id from routes and makes GET request to OMDB to retrieve movie title #14

Merged
merged 1 commit into from
Feb 3, 2018

Conversation

thomasjinlo
Copy link
Contributor

@thomasjinlo thomasjinlo commented Aug 15, 2016

Directions

  1. Go get an api key
  2. Set local ENV as OMDB_API_KEY, with your api key
  3. Run bundle install

box-office.rb Outdated

get '/' do
'Hello world!'
end

get '/movies/:title' do |title|
response = HTTParty.get("http://api.themoviedb.org/3/search/movie?query=#{title}&api_key=#{ENV['TMDB_API_KEY']}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like we talked about it, we can put some direction how to set your local env variable on README

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a minute, why is it a "title" not "imdb id"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I thought we were searching by title, let me see if TMDb let's you query by IMDB id

@kangkyu
Copy link
Member

kangkyu commented Aug 15, 2016

yes.. you can squash the last two commits, because the last one was empty.

@thomas-jung
Copy link

The 3rd commit is empty and even 1st commit is not necessary anymore because you refactored in your own branch before it was merged.

@kangkyu kangkyu mentioned this pull request Aug 15, 2016
@kangkyu
Copy link
Member

kangkyu commented Aug 15, 2016

Personally I think this change #10 should have been merged to master first. It satisfies #2 and #10 has been merged... can you write why that change has been reverted somewhere on Github, as a record? @thomas-jung

@kangkyu
Copy link
Member

kangkyu commented Aug 16, 2016

can you make another PR with only first commit? @thomasjinlo

@thomas-jung
Copy link

@kangkyu I removed commit for #10 because it was also pushed to master directly instead of through PR, so PR should just be reopened again.

@thomasjinlo
Copy link
Contributor Author

I think this PR is ready to go, what you guys think? Should I merge or wait?

@kangkyu
Copy link
Member

kangkyu commented Aug 18, 2016

"wait" for sure, we need to go through the code

@thomasjinlo thomasjinlo changed the title Features#2 Features#2, gets IMDB id from routes and makes GET request to OMDB to retrieve movie title Aug 18, 2016

get '/' do
'Hello world!'
end

get '/movies/:imdbid' do |id|
response = HTTParty.get("http://www.omdbapi.com/?apikey=#{ENV['OMDB_API_KEY']}&i=#{id}&plot=full&r=json")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not good, if we're using dotenv this will most likely change. And also @server-monitor brought up that we should extract all client calls as a separate interface and require it in box-office.

Copy link

@server-monitor server-monitor Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need to add another route just yet. The Hello world route is OK. But if we do TDD, we need to add a test framework first (1 PR), then add the test for the new route and add the route (could be 2 or 1 PRs? I don't know.). If we're not going to do TDD, it could be chaotic but also fun.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep it for this PR, we can change it later when we need. It doesn't hurt DRY not just yet (because even if you extract code, you would use the code only once)

@kangkyu
Copy link
Member

kangkyu commented Aug 27, 2016

Let's merge if you want @thomasjinlo 😄

@kangkyu kangkyu merged commit 235b8e3 into master Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants