当前位置: 首页>>代码示例>>C#>>正文


C# Flickr.PhotosetsGetList方法代码示例

本文整理汇总了C#中FlickrNet.Flickr.PhotosetsGetList方法的典型用法代码示例。如果您正苦于以下问题:C# Flickr.PhotosetsGetList方法的具体用法?C# Flickr.PhotosetsGetList怎么用?C# Flickr.PhotosetsGetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FlickrNet.Flickr的用法示例。


在下文中一共展示了Flickr.PhotosetsGetList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            Flickr flickr = new Flickr(FlickrKey.Key, FlickrKey.Secret);
            Auth auth = null;
            if (File.Exists("key.txt"))
            {
                using (var sr = new StreamReader("key.txt"))
                {
                    flickr.OAuthAccessToken = sr.ReadLine();
                    flickr.OAuthAccessTokenSecret = sr.ReadLine();
                }

            }

            if (!string.IsNullOrEmpty(flickr.OAuthAccessToken) &&
                 !string.IsNullOrEmpty(flickr.OAuthAccessTokenSecret))
            {
                auth = flickr.AuthOAuthCheckToken();
                int g = 56;
            }
            else
            {
                var requestToken = flickr.OAuthGetRequestToken("oob");
                var url = flickr.OAuthCalculateAuthorizationUrl(requestToken.Token, AuthLevel.Delete);
                Process.Start(url);

                var verifier = Console.ReadLine();

                OAuthAccessToken accessToken = flickr.OAuthGetAccessToken(requestToken, verifier);
                flickr.OAuthAccessToken = accessToken.Token;
                flickr.OAuthAccessTokenSecret = accessToken.TokenSecret;

                using (var sw = new StreamWriter("key.txt", false))
                {
                    sw.WriteLine(flickr.OAuthAccessToken);
                    sw.WriteLine(flickr.OAuthAccessTokenSecret);
                }

                auth = flickr.AuthOAuthCheckToken();
                int y = 56;
            }

            var baseFolder = @"D:\MyData\Camera Dumps\";

            var ex = new PhotoSearchExtras();
            var p = flickr.PhotosSearch(new PhotoSearchOptions(auth.User.UserId){Extras = PhotoSearchExtras.DateTaken | PhotoSearchExtras.PathAlias, });
            var sets = flickr.PhotosetsGetList();
            foreach (var set in sets)
            {
                var setDir = Path.Combine(baseFolder, set.Title);
                if ( Directory.Exists(setDir) )
                {
                    var setPhotos = flickr.PhotosetsGetPhotos(set.PhotosetId, PhotoSearchExtras.DateTaken | PhotoSearchExtras.MachineTags | PhotoSearchExtras.OriginalFormat | PhotoSearchExtras.DateUploaded);
                    foreach(var setPhoto in setPhotos)
                    {
                        if (Math.Abs((setPhoto.DateUploaded - setPhoto.DateTaken).TotalSeconds) < 60)
                        {
                            // Suspicious
                            int s = 56;
                        }

                        string ext = ".jpg";
                        if (setPhoto.OriginalFormat != "jpg")
                        {
                            int xxx = 56;
                        }
                        var filePath = Path.Combine(setDir, setPhoto.Title + ext);

                        if (!File.Exists(filePath))
                        {
                            // try mov
                            filePath = Path.Combine(setDir, setPhoto.Title + ".mov");

                            if (!File.Exists(filePath))
                            {
                                Console.WriteLine("not found " + filePath);
                            }
                        }

                        Console.WriteLine(filePath);
                        if ( File.Exists(filePath))
                        {
                            DateTime dateTaken;
                            if (!GetExifDateTaken(filePath, out dateTaken))
                            {
                                var fi = new FileInfo(filePath);
                                dateTaken = fi.LastWriteTime;
                            }

                            if (Math.Abs((dateTaken - setPhoto.DateTaken).TotalSeconds) > 10)
                            {
                                int hmmm = 56;
                            }
                        }
                    }
                }
            }
            //@"D:\MyData\Camera Dumps\"

            int z =  56;
//.........这里部分代码省略.........
开发者ID:jjbott,项目名称:SyncTool,代码行数:101,代码来源:Program.cs

示例2: GetPhotoSetsByUser

        public static PhotosetCollection GetPhotoSetsByUser(string userId)
        {
            Flickr flickr = new Flickr(ConfigurationManager.AppSettings["apiKey"],
                ConfigurationManager.AppSettings["sharedSecret"]);

            return flickr.PhotosetsGetList(userId);
        }
开发者ID:holdenben,项目名称:photoStarter,代码行数:7,代码来源:FlickrBLL.cs

示例3: UploadPhoto

        public IPhoto UploadPhoto(Stream stream, string filename, string title, string description, string tags)
        {
            using (MiniProfiler.Current.Step("FlickrPhotoRepository.UploadPhoto"))
            {
                Flickr fl = new Flickr();

                string authToken = (ConfigurationManager.AppSettings["FlickrAuth"] ?? "").ToString();
                if (string.IsNullOrEmpty(authToken))
                    throw new ApplicationException("Missing Flickr Authorization");

                fl.AuthToken = authToken;
                string photoID = fl.UploadPicture(stream, filename, title, description, tags, true, true, false,
                    ContentType.Photo, SafetyLevel.Safe, HiddenFromSearch.Visible);
                var photo = fl.PhotosGetInfo(photoID);
                var allSets = fl.PhotosetsGetList();
                var blogSet = allSets
                                .FirstOrDefault(s => s.Description == "Blog Uploads");
                if (blogSet != null)
                    fl.PhotosetsAddPhoto(blogSet.PhotosetId, photo.PhotoId);

                FlickrPhoto fphoto = new FlickrPhoto();
                fphoto.Description = photo.Description;
                fphoto.WebUrl = photo.MediumUrl;
                fphoto.Title = photo.Title;
                fphoto.Description = photo.Description;

                return fphoto;
            }
        }
开发者ID:sgwill,项目名称:familyblog,代码行数:29,代码来源:FlickrPhotoRepository.cs

示例4: UpdatePhotoButton_Click

        private void UpdatePhotoButton_Click(object sender, EventArgs e)
        {
            Flickr flickr = new Flickr(ApiKey.Text, SharedSecret.Text, AuthToken.Text);

            flickr.PhotosSetMeta(PhotoId.Text, NewTitle.Text, null);

            OutputTextbox.Text += "Photo title updated";

            PhotosetCollection sets = flickr.PhotosetsGetList();
            Photoset set = sets[0];

            flickr.PhotosetsAddPhoto(set.PhotosetId, PhotoId.Text);
        }
开发者ID:kenpower,项目名称:flickdownloader,代码行数:13,代码来源:UpdateForm.cs

示例5: RemoteInfo

        public RemoteInfo()
        {
            try
            {
                f = new Flickr(Properties.Settings.Default.FlickrApiKey, Properties.Settings.Default.FlickrShared, Properties.Settings.Default.FlickrToken);
                f.Proxy = FlickrSync.GetProxy(true);
                f.OnUploadProgress += new Flickr.UploadProgressHandler(Flickr_OnUploadProgress);
                sets = f.PhotosetsGetList().PhotosetCollection;
                if (sets == null)
                    sets = new Photoset[0];

                string user = User();  //force access to check connection
            }
            catch (Exception ex)
            {
                FlickrSync.Error("Error connecting to flickr", ex, FlickrSync.ErrorType.Connect);
            }
        }
开发者ID:vboctor,项目名称:FlickrSync,代码行数:18,代码来源:RemoteInfo.cs

示例6: ButtonSets_Click

        private void ButtonSets_Click(object sender, EventArgs e)
        {
            var flickr = new Flickr(Program.ApiKey, Program.SharedSecret, Program.AuthToken);
            // Liste des albums
            var sets = flickr.PhotosetsGetList();
            string setlist = "";
            foreach (Photoset pset in sets) setlist += pset.Title + "\n";
            MessageBox.Show("Liste des albums\n" + setlist, "Liste des albums",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            // Statistiques
            var statfile = new System.IO.StreamWriter("albums_stats.csv");
            var reffile = new System.IO.StreamWriter("albums_referrers.csv");
            DateTime day = DateTime.Today;
            statfile.WriteLine("Date;Album;Vues;Favoris;Commentaires");
            reffile.WriteLine("Date;Album;Domain;Views");
            while (day > Program.LastUpdate)
            {
                foreach (Photoset pset in sets)
                {
                    StatusLabel.Text = "Stats de l'album " +
                        pset.Title + " pour le " + day.ToShortDateString();
                    Application.DoEvents();
                    try
                    {
                        var s = flickr.StatsGetPhotosetStats(day, pset.PhotosetId);
                        statfile.WriteLine(day.ToShortDateString() + ";" +
                            pset.Title + ";" + Utility.toCSV(s));
                        var r = flickr.StatsGetPhotosetDomains(day, pset.PhotosetId, 1, 100);
                        reffile.WriteLine(Utility.toCSV(r, day.ToShortDateString() + ";" + pset.Title));
                    }
                    catch(FlickrApiException ex)
                    { }
                }

                day -= TimeSpan.FromDays(1);
            }
            statfile.Close(); reffile.Close();
        }
开发者ID:remyoudompheng,项目名称:flickrstats,代码行数:38,代码来源:MainForm.cs

示例7: Gallery

        // GET: /Gallery/
        public ActionResult Gallery()
        {
            Flickr flickr = new Flickr(myApiKey);

            /*IOrderedEnumerable<FlickrNet.Photoset> photoCollection = flickr.PhotosetsGetList(myId, PhotoSearchExtras.DateTaken).OrderByDescending(d => d.PrimaryPhoto.DateTaken);
            IOrderedEnumerable<FlickrNet.Photo> photoList;

            foreach (Photoset ps in photoCollection)
            {
                ps.PrimaryPhoto.
            }*/

            ViewBag.albumList = flickr.PhotosetsGetList(myId, PhotoSearchExtras.DateTaken | PhotoSearchExtras.MediumUrl).OrderByDescending(d => d.PrimaryPhoto.DateTaken);

            return View();
        }
开发者ID:wmbeers,项目名称:ga-tia,代码行数:17,代码来源:HomeController.cs

示例8: LoadContent

        //public ActionResult LoadContent(string dirName, string pageName)
        //{
        //    var page = ContentService.GetPage(dirName, pageName);
        //    if (page == null) page = new Content();
        //    if (pageName == "index") return View("Index");
        //    else return View("Content", page);
        //}
        public ActionResult LoadContent(string pageName)
        {
            pageName = pageName.ToLower();

            if (pageName == "index")
            {
                var im = new IndexModel();
                var blm = new BlogListModel();
                var posts = BlogService.GetLatestPosts(5);

                blm.ListTitle = "NEWSFLASH";
                blm.Posts = posts;

                im.BlogList = blm;

                return View(pageName, im);
            }
            else if (pageName == "juniors")
            {
                var jm = new JuniorsModel();
                var blm = new BlogListModel();
                var posts = BlogService.GetPostsByCategory("juniors");

                blm.ListTitle = "JUNIORS UPDATES";
                blm.Posts = posts;

                jm.BlogList = blm;

                return View(pageName, jm);
            }
            else if (pageName == "adults")
            {
                var am = new AdultsModel();
                var blm = new BlogListModel();
                var posts = BlogService.GetPostsByCategory("adults");

                blm.ListTitle = "ADULTS UPDATES";
                blm.Posts = posts;

                am.BlogList = blm;

                return View(pageName, am);
            }
            else if (pageName == "construction")
            {
                var cm = new ConstructionModel();
                var blm = new BlogListModel();
                var posts = BlogService.GetPostsByCategory("construction");

                blm.ListTitle = "CONSTRUCTION UPDATES";
                blm.Posts = posts;

                cm.BlogList = blm;

                return View(pageName, cm);
            }
            else if (pageName == "about-us")
            {
                var am = new AboutUsModel();
                var blm = new BlogListModel();
                var posts = BlogService.GetPostsByCategory("general");

                blm.ListTitle = "CLUB NEWS";
                blm.Posts = posts;

                am.BlogList = blm;

                return View(pageName, am);

            }
            else if (pageName == "gallery")
            {
                Flickr flickr = new Flickr(ConfigurationManager.AppSettings["FlickrKey"], ConfigurationManager.AppSettings["FlickrSecret"]);

                FoundUser user = flickr.PeopleFindByEmail("[email protected]");

                var photos = flickr.PhotosetsGetList(user.UserId);

                foreach (var set in photos)
                {
                    Response.Write(set.Title + "<br>");
                }

                return View(pageName);
            }
            else
            {
                return View(pageName);
            }
        }
开发者ID:jasona,项目名称:ManageTennis,代码行数:97,代码来源:ContentController.cs


注:本文中的FlickrNet.Flickr.PhotosetsGetList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。