Flickr.Net Library Source Code Release 1.4.1 (Updated)

Its here!

The next version of the source code now fully supports the new Authentication methods (the older method is no longer supported).

[Download Latest Source](/flickr/flickr-api).

It features lots of changes including:

* AuthGetFrob()
* AuthCalUrl()
* AuthCalcWebUrl() – Often better to use the short url provided by Flickr
* AuthGetToken()
* AuthCheckToken()
* Constructors now take up to 3 parameters, Api Key, Shared Secret and Api Token.
* Support for .config configuration of api key, caching settings and web proxy.

See the Flickr Api page for more details.

Update: minor bug spotted which affects all methods with parameters that can take spaces in them (e..g people.findByUsername where username has a space in it). The signature generation was including the URL encoded version, rather than the original and hence was incorrect. I’ve also added a couple of extra properties, ApiKey, ApiSecret and ApiToken for getting/setting the relevant properties of the Flickr object. V1.4.1 has therefore been released.

25 Replies to “Flickr.Net Library Source Code Release 1.4.1 (Updated)”

  1. hey, are there some current examples or docs for the library since you made the authentication changes?

    could you point me to them, if so?

  2. most excellent. thanks for responding. If i get the time to do something with this (hope hope) I will see if i can help out on your docs/tutorial needs.

  3. (different person) That helped a bit, though real documentation would really hit the spot right now. My question is this: why do I add my api key, secret, and auth token to my Web.Config if I have to pass it in each time? Shouldn’t the library look for the values in the config, allowing me to say Flickr f = new Flickr() and have it all set up for authentication?

  4. In fact, I can’t find FlickrConfigurationManager in the code at all. Why list all that as a new change in this version when it isn’t?

  5. I also just found a series of bugs – the GroupPool stuff has just had its method copy-pasted over and doesn’t have the correct method specified.

  6. You are correct on both of these – I’ve fixed the GroupsPools stuff and once I find out where the hell my FlickrConfigurationManager has gone I will add that back in (which works exactly as you say it should) and do another version release. Sorry for the problems.


  7. Just started playing with this using .Net 2 Beta 2. Only change I have had to make to source code so far was in Flickr.cs:

    private IWebProxy _proxy = WebRequest.DefaultWebProxy; //WebProxy.GetDefaultProxy();

    public IWebProxy Proxy { get { return _proxy; } set { _proxy = value; } }

    The WebProxy.GetDefaultProxy has been marked as obsolete.

    Will you be posting an update after the .Net 2 release?

  8. Hi Sam!

    There is a problem getting the licenses info from Flickr. The patch is very simple:

    > // parameters.Add(“method”, “flickr.licenses.getInfo”);
    > parameters.Add(“method”, “”);

  9. API appears to be missing the method.
    Do you plan to release a version soon?
    I’ll add the method myself in the interrim unless a) I’m blind and it is there or b) You can point me in the direction of the script.


    p.s. Top banana. A very useful library. Cheers.

  10. FYI, There was a very small bug in the PhotosLicensesGetInfo method (flickr complained about a wrong function) so I quickly replaced “flickr.license.getInfo” with “”.

    Thank you for your work, it has been fun using this Library.

  11. After the token is first recieved for a desktop app, the call to ContactsGetList was throwing an exception as in this example:

    f.ApiToken = token;
    u = f.PeopleFindByEmail(“me@this”);
    Person p = f.PeopleGetInfo(u.UserId);
    Contacts c = f.ContactsGetList(); // Exception here

    The Api says the key must be sent with this call, so adding it to the params list made the call work Flickr.cs(757) add:

    parameters.Add(“api_key”, ApiKey);

    And the authenticated call is now made exception free, unless thats a no no too add that line for some reason.


  12. I cannot seem to get the call to work – it always throws a “User not found” exception, even though I’m am clearly passing a valid user id as other calls to user ID based functions work correctly. Any one else having this problem or have I completely missed something?

  13. Found it – does not add the userID parameter to the collection. SImply add
    parameters.Add(“user_id”, userId);
    to the function and it works correctly.

  14. Csn snyone splain whats up with this error and how to fix? Keeps popping up now and then when i do a photosearch.

    FlickrNet.FlickrException was unhandled by user code
    Message=”The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. (9999)”
    Verbose=”The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.”
    at FlickrNet.Flickr.DoGetResponse(String url)

    at FlickrNet.Flickr.GetResponse(NameValueCollection parameters, TimeSpan cacheTimeout)

    at FlickrNet.Flickr.GetResponseCache(NameValueCollection parameters)

    at FlickrNet.Flickr.PhotosSearch(String userId, String tags, TagMode tagMode, String text, DateTime minUploadDate, DateTime maxUploadDate, Int32 license, Int32 perPage, Int32 page, PhotoSearchExtras extras)

    at FlickrNet.Flickr.PhotosSearch(String userId, String tags, TagMode tagMode, String text, Int32 perPage, Int32 page)

  15. My bad, it was perhaps a bit rude to just dump a big ol call stack there. i need to learn some manners. Anyway, did some research and adding req.KeepAlive = false; to around line 170 in flickr.cs does the trick.

    This library rocks, thank you very much for doing.

  16. I’ve fixed all the bugs mentioned here – I just need to get around to packaging.

    I’m also trying to clean the code up slightly.

    We also have the new release of Visual Studio 2005 to consider from now on – I hope to get it working in both.

  17. This is cool Sam, I’m uksing Visual Studio 2005 Beta 2…looking forward to that project package and the file upload method.

  18. I noticed the Person class did not return the photo or profile url, so I added the following lines in person.cs in the appropriate place based on the API documentation. Works like a charm.

    /// The users photo location on Flickr
    public string PhotosUrl;

    /// The users profile location on Flickr
    public string ProfileUrl;

    I should have my Flickr app ready in about a week or two. Looking forward to your next release with all the changes included – great stuff!

  19. Sam,

    Before I get too much further with my app, do you require any acknowledgement on using your Flickr API in other apps? I would be glad to provide a reference to your API in the about box of my application, and a link to wherever you want. Thanks, Rod

  20. Rod: No requirements other than the GPL license if you modify the source code.
    However I’m never gonna object to a bit of pimping. Send them to the /flickr/flickr-api page if you want.

    RT: You can upload files now. Have you got the latest version?

  21. Sam, I’ll download the latest version but with so much to do in all my projects, I’d rather wait for the new release for any compatibilities with VS.Net 2005; esp. since I’m just now getting into your implementation.

    Also, as regards to your comments to Rod about GPL, I’m also wondering about this. Does this require us to put a message on our commercial and/or shareware type app. that says “Download source here” or “Uses Flickr.Net link here” or just a message that says source avail. on request. I have no problem crediting Flickr.Net and a msg that says “Uses Flickr.Net API” but now that I think about it, I’m not so keen on GPL if I don’t understand _which_ GPL as lately there have been variants saying GPL with this exception or that. Credit is good; I’m not so sure about open source for any and all projects…please explain…again, I want to give credit and refer them to your download.

  22. Sam,

    Thank you so much for the fantastic API wrapper.

    I noticed a couple of bugs I had to get around to get things moving.

    Flickr.GetResponse needs to have the ampersand removed from “&api_sig=” when building the url with _sharedSecret. Also, in PhotoInfo.PhotoInfoTag, the TagId attribute needs to be string instead of long.

    I’ve got it working with the 2.0 framework with no problems. I only wish nDoc was ready for 2.0…importing the xml comments doc isn’t supported yet…but its being working on.

    Thanks, Jeff

Comments are closed.