public ActionResult Callback(string oauth_token, string oauth_verifier)
        {
            var tokenSecret = (string)TempData["OAuthTokenSecret"];

            Session["OAuthToken"] = oauth_token;

            var accessToken = _oAuthService.GetAccessToken(oauth_token, tokenSecret, oauth_verifier);

            var parameters       = new OAuthCheckTokenParameters(oauth_token);
            var checkTokenResult = _flickrApi.OAuthCheckToken(parameters);

            ViewBag.CheckTokenResponse = checkTokenResult;

            var getPhotoParameters = new GetPhotosParameters(userId: "27725019@N00")
                                     .PerPage(10);
            var flickrPhotosResult = _flickrApi.PeopleGetPhotos(getPhotoParameters);

            var oAuthModel = new OAuthModel
            {
                AccessToken      = accessToken,
                CheckTokenResult = checkTokenResult,
                Photos           = flickrPhotosResult,
            };

            return(View(oAuthModel));
        }
        public void PeopleGetPhotosTestUnauthorized()
        {
            var request = new GetPhotosParameters(userId: "27725019@N00")
                          .PerPage(30)
                          .Extras(Extras.PathAlias | Extras.UrlS)
            ;
            var result = _flickrApi.PeopleGetPhotos(request);

            Assert.AreEqual("fail", result.Stat);
            Assert.AreEqual(99, result.Code);
            Assert.IsFalse(string.IsNullOrEmpty(result.Message));
        }
        public void PeopleGetPublicPhotosTest()
        {
            var request = new GetPhotosParameters(userId: "27725019@N00")
                          .PerPage(30)
                          .Extras(Extras.PathAlias | Extras.UrlS)
            ;
            var result = _flickrApi.PeopleGetPublicPhotos(request);

            Assert.AreEqual("ok", result.Stat);
            Assert.AreEqual(30, result.Photos.PerPage);
            Assert.AreEqual(1, result.Photos.Page);
        }
Example #4
0
        public void PeopleGetPublicPhotosTest()
        {
            var request = new GetPhotosParameters(userId: "27725019@N00")
                .PerPage(30)
                .Extras(Extras.PathAlias | Extras.UrlS)
                ;
            var result = _flickrApi.PeopleGetPublicPhotos(request);

            Assert.AreEqual("ok", result.Stat);
            Assert.AreEqual(30, result.Photos.PerPage);
            Assert.AreEqual(1, result.Photos.Page);
        }
Example #5
0
        public void PeopleGetPhotosTestUnauthorized()
        {
            var request = new GetPhotosParameters(userId: "27725019@N00")
                .PerPage(30)
                .Extras(Extras.PathAlias | Extras.UrlS)
                ;
            var result = _flickrApi.PeopleGetPhotos(request);

            Assert.AreEqual("fail", result.Stat);
            Assert.AreEqual(99, result.Code);
            Assert.IsFalse(string.IsNullOrEmpty(result.Message));
        }
Example #6
0
        public ActionResult Callback(string oauth_token, string oauth_verifier)
        {
            var tokenSecret = (string) TempData["OAuthTokenSecret"];
            Session["OAuthToken"] = oauth_token;

            var accessToken = _oAuthService.GetAccessToken(oauth_token, tokenSecret, oauth_verifier);

            var parameters = new OAuthCheckTokenParameters(oauth_token);
            var checkTokenResult = _flickrApi.OAuthCheckToken(parameters);
            ViewBag.CheckTokenResponse = checkTokenResult;

            var getPhotoParameters = new GetPhotosParameters(userId: "27725019@N00")
                .PerPage(10);
            var flickrPhotosResult = _flickrApi.PeopleGetPhotos(getPhotoParameters);

            var oAuthModel = new OAuthModel
                {
                    AccessToken = accessToken,
                    CheckTokenResult = checkTokenResult,
                    Photos = flickrPhotosResult,
                };

            return View(oAuthModel);
        }
 public FlickrPhotosResponse PeopleGetPublicPhotos(GetPhotosParameters parameters)
 {
     return(_flickrApiInvoker.Invoke <FlickrPhotosResponse>("flickr.people.getPublicPhotos", parameters));
 }
 public FlickrPhotosResponse PeopleGetPhotos(GetPhotosParameters parameters)
 {
     return _flickrApiInvoker.Invoke<FlickrPhotosResponse>("flickr.people.getPhotos", parameters);
 }