public static void FetchByTag(string tag)
        {
            InstaSharp.Endpoints.Tags.Unauthenticated IGTags = new InstaSharp.Endpoints.Tags.Unauthenticated(Credentials.config);
            InstaSharp.Model.Responses.MediasResponse responTags = IGTags.Recent(tag, "0", "1");
            String resultTags = responTags.Json;
            JsonValue JsonTags = JsonValue.Parse(resultTags);
            String[] ImageURLTags = new String[JsonTags["data"].Count];

            for (int i = 0; i < JsonTags["data"].Count; i++)
            {
                ImageURLTags[i] = (string)JsonTags["data"][i]["images"]["standard_resolution"]["url"];
            }
            _richTextBox2.Clear();
            _richTextBox2.AppendText("Request client: https://api.instagram.com/v1/" + tag + "/snow/media/recent \n");
            _richTextBox2.AppendText("Respon Instagram API: \n");
            for (int i = 0; i < ImageURLTags.Length; i++)
            {
                string output = (string)ImageURLTags[i];
                _richTextBox2.AppendText(output.Replace(@"\", String.Empty) + "\n");
            }
        }
Example #2
0
        private IList <string> GetPhotos()
        {
            var photos = new List <string>();

            try
            {
                var config        = new InstaSharp.InstagramConfig("https://api.instagram.com/v1", "https://api.instagram.com/oauth", "ec801d2b6eff42aaa5dc1d18bfc5e74b", "9c2aa521f5df4019b298a816bcfd4a4c", "http://localhost:56137/");
                var tagSearch     = new InstaSharp.Endpoints.Tags.Unauthenticated(config);
                var searchResults = tagSearch.Recent(HttpUtility.UrlEncode("f1"));

                photos.AddRange(searchResults.Data.Select(x => x.Images.LowResolution.Url).ToList());

                return(photos);
            }
            catch (Exception ex)
            {
                //load the fake photos
                //todo
                photos.Add("http://google.com/image.jpg");
            }
            return(photos);
        }
Example #3
0
        public static void FetchByTag(string tag)
        {
            InstaSharp.Endpoints.Tags.Unauthenticated IGTags     = new InstaSharp.Endpoints.Tags.Unauthenticated(Credentials.config);
            InstaSharp.Model.Responses.MediasResponse responTags = IGTags.Recent(tag, "0", "1");
            String    resultTags = responTags.Json;
            JsonValue JsonTags   = JsonValue.Parse(resultTags);

            String[] ImageURLTags = new String[JsonTags["data"].Count];

            for (int i = 0; i < JsonTags["data"].Count; i++)
            {
                ImageURLTags[i] = (string)JsonTags["data"][i]["images"]["standard_resolution"]["url"];
            }
            _richTextBox2.Clear();
            _richTextBox2.AppendText("Request client: https://api.instagram.com/v1/" + tag + "/snow/media/recent \n");
            _richTextBox2.AppendText("Respon Instagram API: \n");
            for (int i = 0; i < ImageURLTags.Length; i++)
            {
                string output = (string)ImageURLTags[i];
                _richTextBox2.AppendText(output.Replace(@"\", String.Empty) + "\n");
            }
        }
Example #4
0
        private IList<string> GetPhotos()
        {
            var photos = new List<string>();
            try
            {
                var config = new InstaSharp.InstagramConfig("https://api.instagram.com/v1", "https://api.instagram.com/oauth", "ec801d2b6eff42aaa5dc1d18bfc5e74b", "9c2aa521f5df4019b298a816bcfd4a4c", "http://localhost:56137/");
                var tagSearch = new InstaSharp.Endpoints.Tags.Unauthenticated(config);
                var searchResults = tagSearch.Recent(HttpUtility.UrlEncode("f1"));

                photos.AddRange(searchResults.Data.Select(x => x.Images.LowResolution.Url).ToList());

                return photos;
            }
            catch (Exception ex)
            {
                //load the fake photos
                //todo
                photos.Add("http://google.com/image.jpg");
            }
            return photos;
        }