How to Build Cool Projects
without knowing anything
http://ter.ps/hackapi
Sean Bae
HACKATHONS
You see intimidating things
- Machine Learning
- Image Recognition
- Speech Recognition
You see intimidating things
- Machine Learning
- Image Recognition
- Speech Recognition
- More rocket science
- Cure cancer
- Solve world hunger
- What's next?
No need to reinvent the wheel
Web API 101
- Abstraction over implementation
- Access services provided by remote servers
- Useful APIs: http://ter.ps/api1
- APIs to access data: http://ter.ps/api2
Internet at 200,000 Feet
HTTP
Client
(Browser)
Server
request
response
HTTP Requests
- Header
- Holds metadata
- Method
- GET, POST, etc.
- URL
- /v1/api/hacktorial
- Data
Demonstration: GET Request
Run the command:
nc -l 3000
On browser go to:
http://localhost:3000
Demonstration: POST Request
$.ajax({
url: '/api/v1/endpoint',
method: 'POST',
data: data,
success, successCallback,
error: errorCallback
});
HTTP Common Status Codes
- 200 OK
- 202 Accepted
- 301 Moved Permanently
- 404 Not Found
- 500 Internal Server Error
Let's build cool stuff!
Wit.ai
- NLP (Natural Language Processing) Platform
- Powers Facebook M
- https://wit.ai/
Node.js Basics
- JavaScript runtime on V8 Engine
- Event-driven loop
- Single-threaded
- High level of concurrency
while (waitForEvent()) {
processEvent();
}
You are going to build a smart home assistant that:
- Opens/closes the door for you
- Changes the room temperature
High-Level Instructions
- Train your own Wit.ai instance
- Use Web Speech API for voice recognition
- Use AJAX call to retrieve the intent from Wit.ai
- Perform actions
https://github.com/SeanBae/Jarvis/
https://github.com/SeanBae/Jarvis/
git clone https://github.com/SeanBae/Jarvis.git
deck
By seanbae
deck
- 1,062