#What is an API?
#Overview
- What is an API?
- Consumption: Omdbapi Example
- Providing: PetWorld
- Challenge Prep
- Review
#What is an API?
require 'sinatra' | |
require 'typhoeus' | |
require 'json' | |
OMDBAPI_URL = 'http://www.omdbapi.com/' | |
def search_movies(search_string) | |
body = JSON.parse(Typhoeus.get(OMDBAPI_URL, params: {s: search_string} ).body) | |
body['Search'] | |
end |
<h1>Pet World</h1> | |
<div id="petworld_container"></div> | |
<div class="modal fade" id="modal_placeholder" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true"> | |
<a href="#" id="show-modal">Show Modal</a> | |
<script id="owner-form-modal-template" type="text/template"> |
#What is an API?
#Overview
#What is an API?
require 'sinatra' | |
require 'typhoeus' | |
require 'json' | |
OMDBAPI_URL = 'http://www.omdbapi.com/' | |
def search_movies(search_string) | |
body = JSON.parse(Typhoeus.get(OMDBAPI_URL, params: {s: search_string} ).body) | |
body['Search'] | |
end |
desc "launch the console" | |
task "console" do | |
exec 'irb -r ./pwclient.rb' | |
end | |
#Sane CSS Styling
#The Box Model *http://learn.shayhowe.com/html-css/opening-the-box-model/
#(a) CSS Style Guide
account_sid = ENV['TWILIO_ACCOUNT_SID'] | |
auth_token = ENV['TWILIO_AUTH_TOKEN'] | |
from_number = ENV['TWILIO_PHONE_FROM'] | |
to_number = ENV['TWILIO_PHONE_TO'] |
#Exception Handling
#Bullet Points
raise
or fail
#Demo / Live-code Overview
#Javascript Intro
#What the Week Looks Like
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JSample</title> | |
<link rel="stylesheet" type="text/css" href="css/jsample.css"> | |
</head> | |
<body> | |
<div class="container"> |