Ember-youtube-data-model
Very, very, very light and minimal feature wrapper over youtube api/v3 (which I would not pay to use).
Ships with the following 3 models and associated adapters, serializers, and transform:
# youtube/channel YoutubeChannel = DSModelextend title: DSattr "string" description: DSattr "string" thumbnails: DSattr "thumbnails" publishedAt: DSattr "date" uploadId: DSattr "string" uploads: Embercomputed "uploadId"-> # your upload playlist return if EmberisBlank @get "uploadId" @storefind "youtube/playlist"@get"uploadId"
TODO: add more generalized playlists to channel
# youtube/playlist YoutubePlaylist = DSModelextend videos: DShasMany "youtube/video"embedded: true
# youtube/video YoutubeVideo = DSModelextend title: DSattr "string" description: DSattr "string" thumbnails: DSattr "thumbnails" position: DSattr "number" publishedAt: DSattr "date"
You'll need to setup your own API key onto the YoutubeAdapter, I will probably provide a blueprint installer to do this sometime in future, but I'm already sick and tired of working on youtube's horseshit api, so will put that off for another day. For now, probably write your own initializer and reopen the YoutubeAdapter to include something like:
YoutubeAdapterreopen key: 'ajfslasjdfoajsdlfjalsdkfjlkasdf'
After that, things should work, and you should be able to do things like:
chan = storefind "youtube/channel""teamcoco" # finds you Conan O'Brien's channel changet"uploads.videos" # gets you the videos
TODO: add pagination to hasMany to get more than 5 videos (lol)
Installation
git clone
this repositorynpm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.