retriving photo info from photostream

Topics: Developer Forum, User Forum
Jan 16, 2011 at 6:56 AM
Edited Jan 16, 2011 at 8:39 AM

Hi

i am uploading photos to the photostream suppose total count of photos uploaded into photostream is 30 but i am deleting 5 photos manually and now remains 25 but when i am retrieving the photo information it is giving the information of deleted photo also and the count it is showing is 30 below is the code pls tell me how to correct it so that it will tell only the info of remaining photos.. waiting for the reply

//==========================================================================================

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FlickrNet;





namespace ImageUploader
{
    public partial class Form2 : Form
    {

      
         private string tempFrob;
         string ApiKey = "72675e8224b16917b1adb435a17d582f";
         string SharedSecret = "b1ae80bcfc66e7f2";
         FlickrNet.Flickr myFlickr;
       

        public Form2()
        {
            InitializeComponent();
            myFlickr = new FlickrNet.Flickr(ApiKey, SharedSecret);
        }

        private void btnAuthMe_Click(object sender, EventArgs e)
        {
          
            tempFrob = myFlickr.AuthGetFrob();
            // Calculate the URL at Flickr to redirect the user to
            string flickrUrl = myFlickr.AuthCalcUrl(tempFrob, AuthLevel.Delete);
            // The following line will load the URL in the users default browser.
            System.Diagnostics.Process.Start(flickrUrl);

        }


        private void button2_Click(object sender, EventArgs e)
        {
           
          
            try
            {
                FlickrNet.Auth auth = myFlickr.AuthGetToken(tempFrob);
                myFlickr.AuthToken = auth.Token;
               
                MessageBox.Show("User authenticated successfully");
                MessageBox.Show("Authentication token is " + auth.Token);
                MessageBox.Show("User id is " + auth.User.UserId);

            }
            catch (FlickrException ex)
            {
                // If user did not authenticat your application
                // then a FlickrException will be thrown.
                MessageBox.Show("User did not authenticate you");
                MessageBox.Show(ex.ToString());
            }

        }

        private void btnUploading_Click(object sender, EventArgs e)
        {



            string file = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg";
            string title = "Test Photo";
            string descripton = "This is the description of the photo";
            string tags = "tag1,tag2,tag3";
            string photoId = myFlickr.UploadPicture(file, title, descripton, tags);


         
            myFlickr.PhotosSetMeta("5359506476", "New Title", "New Description");        
            myFlickr.PhotosDelete("5359506476");

            PhotoCollection photos = myFlickr.PeopleGetPhotos("me",PhotoSearchExtras.Description);

            foreach (Photo photo in photos)
            {
                MessageBox.Show("Title = " + photo.Title);
                MessageBox.Show("PhotoId = " + photo.PhotoId);
                MessageBox.Show("Description = " + photo.Description);
            }


           
         
        }

      
       
       
    }
}

//==========================================================================================

 

even i have chnge the authentication level to read it does not give the right ans

  private void btnAuthMe_Click(object sender, EventArgs e)
        {
          
            // Get Frob   
            tempFrob = myFlickr.AuthGetFrob();
            // Calculate the URL at Flickr to redirect the user to
            string flickrUrl = myFlickr.AuthCalcUrl(tempFrob, AuthLevel.Read);
            // The following line will load the URL in the users default browser.
            System.Diagnostics.Process.Start(flickrUrl);

        }

Coordinator
Jan 18, 2011 at 10:14 AM

It is likely caching. set Flickr.CacheDisabled to true before making the call to search, or clear the last request after the call with Flickr.Flush(myFlickr.LastRequest).