Toggle navigation
TOC
Project Outline
Deliverables
Presentations
Examples
Leveraging Web Services
Leveraging Web Services
There are many many different kinds of services that deliver their info over a web service.
Use google and
Programmable Web
has thousands of APIs you can use
You might have to call a service directly (using HTTP)
You might find a gem to provide a nicer, limited, ruby apii to the service
You might elect to build your own gem
Good design practice to isolate details of the web service from the rest of the code
Security, Authentication, Money
Several reasons why a service might need authentication
They want to charge for it
They want to force you to register with them so they know who you are
They simply want to put in a speedbump
Most typicall technique
You register on their site (manually) and they give you api token of some kind (a random string)
Every call to the service includes a mandatory paramter
Case study
Problem: Need to get an assortment of information about stocks: price quotes, historical info, and so on.
Steps to solve the problem
Locate an appropriate web service, with google and progammable web site
Investigate whether there is an API, is it REST, is it free or does it cost, do they have the data I want
A bunch of googling led me to two candidates:
Yahoo Stocks Api
and
Markit On Demand
Experiment to see if they do what I need. See
Github Web Service Demo
Build a class or set of classes to encapsulate the API calls. Consider isolation from web service , error handling, caching of common results.
Key Gems to make your life good:
typhoeus
XmlSimple
Delivering Web Services
Providing a Web API from your server
Often nice to provide sample code and a ‘binding’ to a language
Need to decide on the url (REST!)
Latest thinking is that you should not base it on your underlying relational database structure.
In other words, to get title of course 3’s lecture 4
Don’t specify: http://teachback/api/course/3/lecture/4/title
Do specify: http://teachback/api/course_info?code=COSI-234 -> xml structure with info about that course.
Case Study
Goal: Your server needs to respond to HTTP GET for this url: http://teachback/api/course_info?code=COSI-234
Controller: api
Action: course_info
Parameter: code=COSI-234
Let’s take a look at the code in
Github Web Service Demo
Try this url: http://0.0.0.0:3000/api/course_info.xml?course=aaa
Welcome
2018 Syllabus
Calendar of Lectures and homeworks
Resources
Lectures
Pilot Project
Welcome!
Lean Startup
Hypotheses
Working on Teams
MVP
Guest Lecture: Michael Skok
Pilot Project Conclusion
Term Project: Startup
Welcome to Term Projects!
Build Measure Learn
Project Planning
The Pivot
The Engine of Growth
Mockups & Prototypes
Testing Techniques
Term Project: Product
Product Market Fit
Jeffrey Beir: Metrics
Business Models
Pricing Models
Andy Payne: Startup Finance
Intellectual Property
Term Project: Business
Finance for Geeks
Founding a company
Real World Survival Kit
Management and Leadership
Dulcie Madden: Startup Teams
Last day converstation
Term Project
Term Project Outline
Minimum Viable Product Info
Hypotheses
Final Presentations
Background
Learning Goals
Grading
Teachers
Lexicon
Interesting links
Credits and acknowledgements