-
Notifications
You must be signed in to change notification settings - Fork 47
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
Hayden - Edges (C10) - API Muncher #39
base: master
Are you sure you want to change the base?
Conversation
API MuncherWhat We're Looking For
|
ENV["RAILS_ENV"] = "test" | ||
require File.expand_path("../../config/environment", __FILE__) | ||
require "rails/test_help" | ||
require "minitest/rails"require "minitest/reporters" # for Colorized output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a typo here, put a newline between rails"
and require
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
|
||
<style> | ||
body { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go in your stylesheet.
|
||
<body> | ||
<p class="logo"><%= link_to "Food.", root_path %></p> | ||
<ul class="login"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put this stuff in a header
or other container tag.
data = HTTParty.get(url) | ||
end | ||
|
||
if data.include?("Error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good that you're checking things here.
|
||
private | ||
|
||
def self.recipe_squeezer(hits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method name isn't really very descriptive of what it does.
encoded_url = URI.encode(url) | ||
data = HTTParty.get(encoded_url) | ||
|
||
if data.include?("Error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if data.body
is [], this is going to crash.
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
lib
? How would your project change if you needed to interact with more than one API (aka more than just the Edamam API)?