예제 #1
0
 public FacebookApiClient(
     IRestSharpClientFactory clientFactory,
     IFacebookConfiguration facebookConfiguration)
 {
     _clientFactory         = clientFactory;
     _facebookConfiguration = facebookConfiguration;
 }
예제 #2
0
 /// <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()));
 }
예제 #3
0
 /// <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());
 }
예제 #4
0
 /// <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());
 }
예제 #5
0
 /// <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());
 }
예제 #6
0
 /// <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());
 }
예제 #7
0
 /// <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());
 }
예제 #8
0
 /// <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));
 }
예제 #9
0
 /// <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()));
 }
예제 #10
0
 /// <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());
 }