public static async Task<string> SearchAsync(double latitude, double longitude, OAuthResponse oAuthResponse)
        {
            var media = new InstaSharp.Endpoints.Media(InstagramConfig, oAuthResponse);
            var searchResults = await media.Search(latitude, longitude, 5000);

            return SerializeResults(searchResults.Data);
        }
示例#2
0
        public static async Task <string> SearchAsync(double latitude, double longitude, OAuthResponse oAuthResponse)
        {
            var media         = new InstaSharp.Endpoints.Media(InstagramConfig, oAuthResponse);
            var searchResults = await media.Search(latitude, longitude, 5000);

            return(SerializeResults(searchResults.Data));
        }
        public MediaController()
        {
            var instance = InstaSharpConfig.Instance;

            _media = new InstaSharp.Endpoints.Media(instance.config, instance.oauthResponse);
            _likes = new Endpoints.Likes(instance.config, instance.oauthResponse);
            _comments = new Endpoints.Comments(instance.config, instance.oauthResponse);
        }
示例#4
0
        public async Task<ActionResult> NearMe()
        {
            var oAuthResponse = Session["FRED.AuthInfo"] as OAuthResponse;

            if (oAuthResponse == null)
            {
                return RedirectToAction("Login");
            }
            var locations = new InstaSharp.Endpoints.Media(config, oAuthResponse);
            var geo = new InstaSharp.Endpoints.Geographies(config, oAuthResponse);
            var start = DateTime.Now - TimeSpan.FromDays(1);
            var end = DateTime.Now;
            var posts = new List<WallElement>();
            return View(posts);
        }
示例#5
0
 public async Task<ActionResult> FullInfo2(double latitude, double longitude)
 {
     if (latitude == 0)
     {
         return View();
     }
     ModelState.Clear();
     var oAuthResponse = Session["FRED.AuthInfo"] as OAuthResponse;
     if (oAuthResponse == null)
     {
         return RedirectToAction("Login");
     }
     var InstagramId = oAuthResponse.User.Id.ToString();
     var locations = new InstaSharp.Endpoints.Media(config, oAuthResponse);
     var geo = new InstaSharp.Endpoints.Geographies(config, oAuthResponse);
     var start = DateTime.Now - TimeSpan.FromDays(1);
     var end = DateTime.Now;
     var locFeed = await locations.Search(latitude, longitude, 5000, start, end);
     var posts = new List<WallElement>();
     foreach (var post in locFeed.Data)
     {
         posts.Add(InstsharpMedia2WallElement(post, latitude, longitude));
     }
     posts = posts.OrderBy(x => x.Distance).ToList();
     //var temp = CreateWall(posts, oAuthResponse.User.Id.ToString());
     return View(posts);
 }