TIY-DC-ROR-2015-Jan / course-notes

Syllabus, notes, and more for the class
0 stars 3 forks source link

SayaaS #182

Open jamesdabbs opened 9 years ago

jamesdabbs commented 9 years ago

Due on Feb 19 @ 05:00pm Make a say server so your friends can make your computer talk to you

Objectives

Learning Objectives

After completing this assignment, you should…

After completing this assignment, you be able to effectively use

require 'httparty'

url = "http://localhost:4567" # update this if needed

HTTParty.post "#{url}/cellos", body: { phrase: 'Droid' }
sleep 1

HTTParty.post "#{url}/badnews", body: { phrase: 'Daisy, Daisy, give me your answer do' }
sleep 1

# Add other examples here

puts HTTParty.get "#{url}/log?limit=5"

Requirements

Implement endpoints POST /cellos and POST /badnews that take a phrase param and say that phrase with the associated voice.

Any call to say should be logged for auditing later. Record the time and ip address of the requester. GET /logs?limit=n should show the n most recent such requests.

You are encouraged to add more voices and examples as you see fit.

Hard Mode

Maintain a whitelist of ips allowed to use the service. Automatically block users if they make too many calls per minute.

Notes

Be very careful exposing system calls to the outside world. Think about how a malicious user could use them to attack your system.

Additional Resources