ardyhim

youtube.ts

Sep 23rd, 2016
623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Injectable } from '@angular/core';
  2. import { Http } from '@angular/http';
  3. import 'rxjs/add/operator/map';
  4.  
  5. /*
  6.   Generated class for the Youtube provider.
  7.  
  8.   See https://angular.io/docs/ts/latest/guide/dependency-injection.html
  9.   for more info on providers and Angular 2 DI.
  10. */
  11. @Injectable()
  12. export class Youtube {
  13.   key = 'AIzaSyDO1Sk4LXK5b2-XMuGGnGzxNbuFDC-ZDOE';
  14.   constructor(private http: Http) {}
  15.  
  16.   playlist(channel){
  17.     return this.http.get("https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId="+channel+"&key="+this.key)
  18.   }
  19.  
  20.   playlist_page(channel, pageToken){
  21.     return this.http.get("https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId="+channel+"&pageToken="+pageToken+"&key="+this.key)
  22.   }
  23.  
  24.   playlistList(playlistId){
  25.     return this.http.get("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId="+playlistId+"&key="+this.key)
  26.   }
  27.  
  28.   playlistList_page(playlistId, pageToken){
  29.     return this.http.get("https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&pageToken="+pageToken+"&playlistId="+playlistId+"&key="+this.key)
  30.   }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment