From e60936158e2d43380792d7be8c65260e891f1ba3 Mon Sep 17 00:00:00 2001 From: migueesc123 Date: Wed, 14 Jun 2017 23:15:50 -0500 Subject: [PATCH] Subscribers list is unfeasible at this stage. Removed the subscirbers function --- YoutubeAnalytics/YoutubeAnalytics.pq | 38 ++++++++++------------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/YoutubeAnalytics/YoutubeAnalytics.pq b/YoutubeAnalytics/YoutubeAnalytics.pq index 0682949..9ef8176 100644 --- a/YoutubeAnalytics/YoutubeAnalytics.pq +++ b/YoutubeAnalytics/YoutubeAnalytics.pq @@ -32,15 +32,26 @@ scopes = { [DataSource.Kind="YoutubeAnalytics", Publish="YoutubeAnalytics.Publish"] +shared YoutubeAnalytics.Navigation = Value.ReplaceType(Navigation, NavigationType); -shared YoutubeAnalytics.Navigation = () => +NavigationType = type function () as table meta [ + Documentation.Name = "Youtube Analytics", + Documentation.LongDescription = "Returns a table with key Youtube Data API and Youtube Analytics API data", + Documentation.Examples = {[ + Description = "Returns a table with key Youtube Data API and Youtube Analytics API data", + Code = "YoutubeAnalytics.Navigation () ", + Result = "A table with key Youtube Data API and Youtube Analytics API data" + ]} + ] +; + + Navigation = () => let objects = #table( {"Name", "Key", "Data", "ItemKind", "ItemName", "IsLeaf"},{ {"Channel", "YoutubeAnalytics.ChannelInfo", YoutubeAnalytics.ChannelInfo(), "Table", "Table", true}, {"Videos", "YoutubeAnalytics.Videos", YoutubeAnalytics.Videos(), "Table", "Table", true}, {"Countries", "YoutubeAnalytics.Countries", YoutubeAnalytics.Countries(), "Table", "Table", true}, - {"Subscribers", "YoutubeAnalytics.Subscribers", YoutubeAnalytics.Subscribers(), "Table", "Table", true}, {"Video Stats", "YoutubeAnalytics.VideoStats", YoutubeAnalytics.VideoStats, "Function", "Function", true}, {"Daily Subscribers", "YoutubeAnalytics.DailySubscribers", YoutubeAnalytics.DailySubscribers, "Function", "Function", true}, {"GET Reports", "YoutubeAnalytics.GETReports", YoutubeAnalytics.GETReports, "Function", "Function", true}, @@ -367,29 +378,6 @@ each [nextPageToken] <> null or [prevPageToken] <> null or [Counter] <= 1 , in #"Changed Type12"; - [DataSource.Kind="YoutubeAnalytics"] - YoutubeAnalytics.Subscribers = () => -let - ///Code originally created by Imke http://www.thebiccountant.com/ - Baseurl = "https://www.googleapis.com/youtube/v3/subscriptions?part=subscriberSnippet&maxResults=50&mySubscribers=true&pageToken=", - Source = List.Generate( ()=> - [Result = null , nextPageToken =null, prevPageToken= null, Counter = 0], -each [nextPageToken] <> null or [prevPageToken] <> null or [Counter] <= 1 , - each [Result = if [nextPageToken] = null and [prevPageToken] = null then - Json.Document( - Web.Contents( - Baseurl)) - else Json.Document( - Web.Contents( - Baseurl& [nextPageToken])), - nextPageToken = try Result[nextPageToken] otherwise null, - prevPageToken = try Result[prevPageToken] otherwise null, - Counter = [Counter] + 1 ], each [Result]), - #"Removed Top Items" = List.Skip(Source,1) - ///End of Imke's code. Please visit her page! http://www.thebiccountant.com/ - in - #"Removed Top Items"; - // Data Source Kind description YoutubeAnalytics = [ Authentication = [