Popular() 공개 메소드

Finds the most popular media on instagram right now. http://instagram.com/developer/endpoints/media/#get_media_popular
public Popular ( string clientId ) : ApiResponse
clientId string
리턴 ApiResponse
예제 #1
0
        public ActionResult Popular()
        {
            try {

                MediaClient mediaClient = new MediaClient(base.userToken.access_token);
                ApiResponse<FeedItem> popular = mediaClient.Popular(EnvironmentHelpers.GetConfigValue("ClientId"));

                ViewData["Photos"] = popular.data;
            } catch { }

            return View();
        }
예제 #2
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            try {
                if (userToken != null) {
                    UsersClient client = new UsersClient(userToken.access_token);
                    ApiResponse<FeedItem> recentMedia = client.RecentMedia(null, null, null);

                    ViewData["UserData"] = client.User(null).data;

                    if (recentMedia != null) {
                        ViewData["RecentMedia"] = recentMedia.data.Take(6).ToList();
                        ViewData["Following"] = client.Follows(null).data.Take(12).ToList();
                        ViewData["FollowedBy"] = client.FollowedBy(null).data.Take(12).ToList();
                    }
                } else {
                    MediaClient mediaClient = new MediaClient("");
                    ViewData["Popular"] = mediaClient.Popular(EnvironmentHelpers.GetConfigValue("ClientId")).data;
                    ViewData["Authenticated"] = "false";
                }
            } catch { }

            base.OnActionExecuting(filterContext);
        }