problem with PhotosSetMeta("p_ID,title,descreption)

Topics: Developer Forum, Project Management Forum, User Forum
Mar 20, 2012 at 3:34 PM
Edited Mar 20, 2012 at 3:36 PM

hay guys im new here :)

Im having some problem with the flicker api, im trying to create a page where can i change titles and descreptions for photos i have on my account (personal use).

 i wrote some code that work only in DEBUG mode, AND i got to redirct the user to the site so he can give premission for changing stuff on his account every time.

When i run the code without debuging i get an error  Invalid frob (108).

here is the code:

 

flicker = new Flickr(key, secret);
                FlickrNet.Cache.CacheDisabled = true;

                string frob = flicker.AuthGetFrob();
                string flickrUrl = flicker.AuthCalcUrl(frob, AuthLevel.Write);

                

                System.Diagnostics.Process.Start(flickrUrl);
                
                Auth auth = new Auth();
                auth = flicker.AuthGetToken(frob);

    
                flicker.PhotosSetMeta("6959366981", "darp harp", "Cohala in the zoo?");

1 i want to know if is it possible to check if i allredy got promision to edit stuff on my account,
   so i wont need to redirct the page every time i want to change somthing.

2 why is this code only work in debug mode (single-steping)? 

3 sorry for my english ^^
Coordinator
Mar 21, 2012 at 10:46 AM

You can store the authentication token you receive from AuthGetToken and use it later. Store it in a cookie or something if it a user setting.

Is the above inside a web app? If so you should be using AuthCalcWebUrl and redirecting the user to authenticate using Response.Redirect, and then when they get redirected back taking the frob from the querystring to get your auth token.

Mar 21, 2012 at 3:44 PM

i change the code to what you suggested but still have problem that afther the user accept to make the change how to i redirect him back to my appliction?

flicker give me this message:

   Oops! Flickr can't find a valid callback URL.

here is the code im using now:

 

                flicker = new Flickr(key, secret);
                FlickrNet.Cache.CacheDisabled = true;

                
                string flickrUrl = flicker.AuthCalcWebUrl(AuthLevel.Write);

                Response.Redirect(flickrUrl);
                
                 frob = Request.QueryString["frob"];
                
                Auth auth = flicker.AuthGetToken(frob);
                auth.Permissions = AuthLevel.Write;
               
                flicker.PhotosSetMeta("6959366981", "Title:DANDIOOLA", "Descreption:SOUPRISE");

 

how do i keep going? (im pretty new to asp.net)

 

thx for the help.

Coordinator
Mar 21, 2012 at 4:17 PM

You need to configure the callback URL for your flickr ap key - I think the link is called "edit authentication flow" or something similar.

And those two parts of your code will need to be two different web pages - you can't just continue the code.

Sam

Mar 21, 2012 at 4:33 PM

thanks for the fast reply :)

Befor you post I just configured the callback URL, but befor that i change the app to a desktop appliction that could be the problem?

should i just create new app in flickr and get new api key?

 

what is the second part of the code i need to put in a diffrent page?

is it :

frob = Request.QueryString["frob"]; ?

and what come afther that?


agian thank for the help:) 
Mar 21, 2012 at 5:12 PM

ITS WORKING i did what you say!

2 pages:

1 of authentication

and then 1 of sending the changes i want to do

and afther i auth the first time i dont need to redirct my self to flicker it redirct to my site automticly

 

thank you very much for all the help!

btw did you wroth the FlickrNet api?

 

(sorry for my english ^^)

Coordinator
Mar 22, 2012 at 8:50 AM

Glad you got it working.

Yes, I wrote the FlickrNet library.

Sam

Mar 22, 2012 at 10:50 AM

i know this is gone off topic, but still i want to say thank personally for this great api amazing work!