An open API service indexing awesome lists of open source software.

https://github.com/delner/minitube

A RoR web-service demo.
https://github.com/delner/minitube

Last synced: 9 months ago
JSON representation

A RoR web-service demo.

Awesome Lists containing this project

README

          

MiniTube
========

A Ruby on Rails web-service demo. It acts as a service that describes videos, and their viewing policy per region. The business question it seeks to address is something like *"How should I display this video in the United States? With ads? For free? Is it blocked due to copyright?"*

Requirements
------------
MiniTube runs on Ruby on Rails 3.2: you must have Ruby 1.9.3 installed, along with Memcached & MySQL.

Technical details
-----------------
The finer explanation of how it works is detailed in this technical specification Google Doc:

https://docs.google.com/document/d/1AQ-ZVj9G5V2iBjWi6FBX_3CSmvPJ4Bz9DFlvxNR5oEk/edit?usp=sharing

How to run it
-------------
1. Clone the repository locally.
2. Run `bundle install` in the project directory to install the necessary gems.
3. Create a `database.yml` file in your `config` directory that points to your MySQL server.
4. Run `rake db:create` and `rake db:migrate` to setup your database
5. Run `rake db:seed` to generate some test data to work with.
- You can adust the amount of test data generated by changing the `stress_level` variable in the seed file.
6. Make sure your memcached server is running locally, then run `rails s` to start the service.

*NOTE:* In its current state, the service isn't very configurable. It depends on a locally running Memcached server, and certain variables are hard-coded. (Configurability is a work in progress!)

Querying the service:
---------------------
There are 3 views included in the service:
- `/policies`: Returns all policies for all videos in all regions.
- `/policies/available/`: Returns all policies for videos who are not blocked in the specified country. `country` is a case-sensitive ISO code (http://en.wikipedia.org/wiki/ISO_3166-1)
- `/policies/video//country/`: Returns the policy for a single video in a single region. `country` is the same as above. `video_id` is a 1-8 character ID potentially consisting of numbers, letters or symbols (case-sensitive.)

See the demo:
-------------
The demo of this application is available at http://demo.davidelner.com

Views:
- http://demo.davidelner.com/policies
- http://demo.davidelner.com/policies/available/US
- http://demo.davidelner.com/policies/video/15/country/US