public FacebookApiClient( IRestSharpClientFactory clientFactory, IFacebookConfiguration facebookConfiguration) { _clientFactory = clientFactory; _facebookConfiguration = facebookConfiguration; }
/// <summary> /// Gets the photos URL. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static string GetPhotosUrl(IFacebookConfiguration config) { return(string.Format("{0}/{1}?fields={2}&access_token={3}", URL, config.Subscription, FacebookItemCategory.Photos.ToString().ToLower(), config.GetToken())); }
/// <summary> /// Gets the picture. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookPicture GetPicture(this IFacebookConfiguration config) { return(JsonHelper.GetItem <PictureContainer>(GetPictureUrl(config)).ConvertPicture()); }
/// <summary> /// Gets the events. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookEvent[] GetEvents(this IFacebookConfiguration config) { return(JsonHelper.GetItem <EventsContainer>(GetEventsUrl(config)).ConvertEvent()); }
/// <summary> /// Gets the photos. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookPhoto[] GetPhotos(this IFacebookConfiguration config) { return(JsonHelper.GetItem <PhotosContainer>(GetPhotosUrl(config)).ConvertPhoto()); }
/// <summary> /// Gets the videos. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookAlbum[] GetAlbums(this IFacebookConfiguration config) { return(JsonHelper.GetItem <AlbumsContainer>(GetAlbumsUrl(config)).ConvertAlbum()); }
/// <summary> /// Gets the videos. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookVideo[] GetVideos(this IFacebookConfiguration config) { return(JsonHelper.GetItem <VideosContainer>(GetVideosUrl(config)).ConvertVideo()); }
/// <summary> /// Gets the token. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static string GetToken(this IFacebookConfiguration config) { return(GetToken(config.AppId, config.AppSecret)); }
/// <summary> /// Gets the subscription URL. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static string GetSubscriptionUrl(IFacebookConfiguration config) { return(string.Format("{0}/{1}?access_token={2}", URL, config.Subscription, config.GetToken())); }
/// <summary> /// Gets the subscription. /// </summary> /// <param name="config">The configuration.</param> /// <returns></returns> public static FacebookSubscription GetSubscription(this IFacebookConfiguration config) { return(JsonHelper.GetItem <Page>(GetSubscriptionUrl(config)).Convert()); }