Make hot fire channels
To set up an Amazon Fire channel for a YouTube user, follow the instructions below:
- Create an S3 bucket in the "US Standard" region (
us-east-1) enabled for static website hosting, withindex.htmlas the landing page, and configure permissions so thatGetObjectaccess permissions are allowed to the world. For each user, you will create a separate bucket, so you may want to name it something likeYOUTUBE_USER_NAME-fire-channel. - Create a Google Developer project, enable the YouTube Data API, and create a browser key accepting requests from the hostname associated with your bucket. If you named your bucket as suggested above, it will be
YOUTUBE_USER_NAME-fire-channel.s3-website-us-east-1.amazonaws.com. In general, for static website hosting buckets inus-east-1, it will beBUCKET_NAME.s3-website-us-east-1.amazonaws.com. - Modify
js/init.jsin this directory, replacing theuserfield with theYOUTUBE_USER_NAMEfor whom you're creating the channel, and thedevKeyfield with the browser key created in the previous step. - Sync the contents of this directory with your S3 bucket, e.g. using the
s3cmdcommand line tool:s3cmd sync . s3://BUCKET_NAME. - Navigate to
BUCKET_NAME.s3-website-us-east-1.amazonaws.comin your browser.
This project is currently configured to create a channel for TheYoungTurks. The devKey in js/init.js will only work for that referer, so it is safe to leak the credential. The left nav is pretty slick, it even has a working Search functionality. Notice the branding ("TYT" logo) in the top right.
YouTube ads don't work, and you'll probably want to serve ads from a different source rather than from YouTube anyways. This will require significantly changing how the underlying code works, including extracting and hosting the YouTube video separately; right now it streams directly from YouTube.
Having to create a browser key for each YouTube user will not scale. You will want to purchase a domain, set up a single browser key accepting *.YOUR_DOMAIN as valid referrers, and then configure DNS and S3 so that YOUTUBE_USER_NAME.YOUR_DOMAIN serves the content in whatever bucket you create for that user. Because buckets will be created dynamically, a pattern similar to Heroku's might be ideal: YOUTUBE_USER_NAME-fire-channel-RANDOM_GUID.
This project is just a prototype proof of concept, and is a direct copy-past of this with an added README and a couple config changes to js/init.js.