예제 #1
0
        /// <summary>
        /// Get a list of recent media objects from a given location.
        /// </summary>
        /// <param name="locationId">The ID of the location.</param>
        /// <param name="options">The options for the search.</param>
        public string GetRecentMedia(int locationId, InstagramLocationSearchOptions options)
        {
            // Declare the query string
            NameValueCollection qs = new NameValueCollection();

            // Add any extra options
            if (options != null)
            {
                if (options.MinTimestamp > 0)
                {
                    qs.Add("min_timestamp", options.MinTimestamp.ToString(CultureInfo.InvariantCulture));
                }
                if (options.MaxTimestamp > 0)
                {
                    qs.Add("max_timestamp", options.MaxTimestamp.ToString(CultureInfo.InvariantCulture));
                }
                if (!String.IsNullOrWhiteSpace(options.MinId))
                {
                    qs.Add("min_id", options.MinId);
                }
                if (!String.IsNullOrWhiteSpace(options.MaxId))
                {
                    qs.Add("max_id", options.MaxId);
                }
            }

            // Perform the call to the API
            return(Client.DoAuthenticatedGetRequest("https://api.instagram.com/v1/locations/" + locationId + "/media/recent", qs));
        }
        /// <summary>
        /// Search for media in a given area. The default time span is set to 5 days. The time span must not
        /// exceed 7 days. Defaults time stamps cover the last 5 days. Can return mix of image and video types.
        /// </summary>
        /// <param name="options">The search options.</param>
        public string Search(InstagramLocationSearchOptions options)
        {
            // Declare the query string
            NameValueCollection qs = new NameValueCollection {
                { "access_token", Client.AccessToken },
                { "lat", options.Latitude.ToString(CultureInfo.InvariantCulture) },
                { "lng", options.Longitude.ToString(CultureInfo.InvariantCulture) }
            };

            // Optinal options
            if (options.Distance > 0)
            {
                qs.Add("distance", options.Distance + "");
            }
            if (options.MinTimestamp > 0)
            {
                qs.Add("min_timestamp", options.MinTimestamp + "");
            }
            if (options.MaxTimestamp > 0)
            {
                qs.Add("max_timestamp", options.MaxTimestamp + "");
            }

            // Perform the call to the API
            return(SocialUtils.DoHttpGetRequestAndGetBodyAsString("https://api.instagram.com/v1/media/search", qs));
        }
예제 #3
0
 /// <summary>
 /// Get a list of recent media objects from a given location.
 /// </summary>
 /// <param name="location">The location.</param>
 /// <param name="options">The options for the search.</param>
 public string GetRecentMedia(InstagramLocation location, InstagramLocationSearchOptions options)
 {
     if (location == null)
     {
         throw new ArgumentNullException("location");
     }
     return(GetRecentMedia(location.Id, options));
 }
 /// <summary>
 /// Gets a list of locations with a geographic coordinate within the radius of blah blah blah.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 /// <see cref="http://instagram.com/developer/endpoints/locations/#get_locations_search"/>
 public SocialHttpResponse Search(InstagramLocationSearchOptions options) {
     return Client.DoAuthenticatedGetRequest("https://api.instagram.com/v1/locations/search", options);
 }
예제 #5
0
 /// <summary>
 /// Search for media in a given area. The default time span is set to 5 days. The time span must not
 /// exceed 7 days. Defaults time stamps cover the last 5 days. Can return mix of image and video types.
 /// </summary>
 /// <param name="options">The search options.</param>
 public InstagramRecentMediaResponse Search(InstagramLocationSearchOptions options)
 {
     return(InstagramRecentMediaResponse.ParseJson(Raw.Search(options)));
 }
예제 #6
0
 /// <summary>
 /// Search for a location by geographic coordinate.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 /// <see cref="http://instagram.com/developer/endpoints/locations/#get_locations_search"/>
 public SocialHttpResponse Search(InstagramLocationSearchOptions options)
 {
     return(Client.DoAuthenticatedGetRequest("https://api.instagram.com/v1/locations/search", options));
 }
 /// <summary>
 /// Get a list of recent media objects from a given location.
 /// </summary>
 /// <param name="locationId">The ID of the location.</param>
 /// <param name="options">The options for the search.</param>
 public InstagramRecentMediaResponse GetRecentMedia(int locationId, InstagramLocationSearchOptions options)
 {
     return(InstagramRecentMediaResponse.ParseJson(Raw.GetRecentMedia(locationId, options)));
 }
 /// <summary>
 /// Search for a location by geographic coordinate.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 /// <see cref="http://instagram.com/developer/endpoints/locations/#get_locations_search"/>
 public InstagramLocationsResponse Search(InstagramLocationSearchOptions options)
 {
     return(InstagramLocationsResponse.ParseResponse(Raw.Search(options)));
 }
 /// <summary>
 /// Search for a location by geographic coordinate.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 /// <see cref="http://instagram.com/developer/endpoints/locations/#get_locations_search"/>
 public InstagramLocationsResponse Search(InstagramLocationSearchOptions options) {
     return InstagramLocationsResponse.ParseResponse(Raw.Search(options));
 }