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 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); }
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); }
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); }