/// <summary>
 /// Get a lsit of medias from given location.
 /// </summary>
 public List <Models.IMedia> GetLocationMedias(long id, int count = 0)
 {
     try
     {
         return(mediaController.MapJsonToMedias(InstagramHttpClient
                                                .LocationEndPoint
                                                .GetRecentMediasWithLocationAPICall(id, count)));
     }
     catch (Exceptions.InstagramAPICallException e)
     {
         throw e;
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Get a list of medias tagged with tag "tagName".
 /// </summary>
 public List <Models.IMedia> GetTaggedMedia(string tagName, int count = 0)
 {
     try
     {
         return(mediaController.MapJsonToMedias(
                    InstagramHttpClient
                    .TagsEndPoint
                    .GetRecentMediasWithTagAPICall(tagName, count)));
     }
     catch (Exceptions.InstagramAPICallException e)
     {
         throw e;
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns a list of recent medias near to the specified location.
 /// </summary>
 /// <param name="distance">Distance in meters, max = 5000</param>
 public List <IMedia> SearchMediaNearLocation(double latitude, double longitude, double distance = 0)
 {
     try
     {
         return(mediaJsonController.MapJsonToMedias(MediaEndPoint
                                                    .SearchMediaAPICall(latitude,
                                                                        longitude,
                                                                        distance)));
     }
     catch (Exceptions.InstagramAPICallException e)
     {
         throw e;
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a list with recent media of specified user.
 /// </summary>
 /// <exception cref="Exceptions.InstagramAPICallException">Application authorization error.</exception>
 public List <Models.IMedia> GetUserRecentMedia(IUsersQueryParameters parameter = null)
 {
     try
     {
         // Some parameters specified
         if (parameter != null)
         {
             // With only count
             if (parameter.Count != null)
             {
                 return(mediaJsonController
                        .MapJsonToMedias(UserEndPoint.APICall(parameter.Id.ToString() + "/media/recent",
                                                              new Dictionary <string, string>()
                 {
                     { "count", parameter.Count.Value.ToString() }
                 })));
             }
             // With count and id
             else
             {
                 return(mediaJsonController
                        .MapJsonToMedias(UserEndPoint.APICall(parameter.Id.ToString() + "/media/recent",
                                                              new Dictionary <string, string>()
                 {
                     { "count", parameter.Count.Value.ToString() }
                 })));
             }
         }
         // No parameters
         return(mediaJsonController
                .MapJsonToMedias(UserEndPoint.APICall("self/media/recent")));
     }
     catch (Exceptions.InstagramAPICallException e)
     {
         throw new Exceptions.InstagramAPICallException(e.ToString());
     }
     catch (Exception)
     {
         return(null);
     }
 }