コード例 #1
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 string Search(InstagramRecentMediaSearchOptions 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));
        }
コード例 #2
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(InstagramRecentMediaSearchOptions options)
 {
     return(InstagramRecentMediaResponse.ParseJson(Raw.Search(options)));
 }
コード例 #3
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>
 /// <see cref="http://instagram.com/developer/endpoints/media/#get_media_search"/>
 public SocialHttpResponse Search(InstagramRecentMediaSearchOptions options) {
     return Client.DoAuthenticatedGetRequest("https://api.instagram.com/v1/media/search", options);
 }