Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    getting photoset from flickr

    hello ppl, I am new in javascript and am trying to get photoset photos from flickr. I am using an example code and I got this:

    Code:
    !(function(){
        'use strict';
        // Get some photos from Flickr for the demo
        $.ajax({
            url: 'http://api.flickr.com/services/rest/',
            data: {
                format: 'json',
                method: 'flickr.photosets.getPhotos',
                api_key: 'cf2db77743310b887e635de84dd7c27b',
                photoset_id: '72157632359075734+',
                auth_token: '72157632392212764-930065b09397fd45',
                api_sig: 'd94b6924abf1d58bf8ff4f015c8ec042'
            },
    	    dataType: 'jsonp',
            jsonp: 'jsoncallback'
        }).done(function (data){
            var gallery = $('#gallery'), url;
            $.each(data.photoset, 
                function (index, photo) {
                url = 'http://farm' + photo.farm + '.static.flickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
    			var img = $('<img>').prop({'src': url + '_s.jpg', 'title': photo.title});
                var link = $('<a rel="gallery">')
    						.append( img )
    						.prop('href', url + '_b.jpg')
    						.appendTo(gallery);
    			// lazy show the photos one by one
    			img.on('load', function(e){
    				setTimeout( function(){ link.addClass('loaded'); }, 20*index);
    			});
            });
    		
    		// finally, initialize photobox on all retrieved images
    		$('#gallery').find('a').photobox({ thumbs:true });
        });
    from this website but its not getting any photos, what am I doing wrong? plz help an newb uit thanks and "Happy New Year!!"

    p.s. forgot to tell that I am getting this error message:

    Source File: http://ajax.googleapis.com/ajax/libs.../jquery.min.js
    Line: 2
    Last edited by hiawatha; 12-31-2012 at 03:52 PM.

  • #2
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dont know what happend with my post.

    I used example code from this source to get my photos on the website and it looks like this:
    Code:
    !(function(){
        'use strict';
        // Get some photos from Flickr for the demo
        $.ajax({
            url: 'http://api.flickr.com/services/rest/',
            data: {
                format: 'json',
                method: 'flickr.photosets.getPhotos',
                api_key: 'cf2db77743310b887e635de84dd7c27b',
                photoset_id: '72157632359075734+',
                auth_token: '72157632392212764-930065b09397fd45',
                api_sig: 'd94b6924abf1d58bf8ff4f015c8ec042'
            },
    	    dataType: 'jsonp',
            jsonp: 'jsoncallback'
        }).done(function (data){
            var gallery = $('#gallery'), url;
            $.each(data.photoset, 
                function (index, photo) {
                url = 'http://farm' + photo.farm + '.static.flickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
    			var img = $('<img>').prop({'src': url + '_s.jpg', 'title': photo.title});
                var link = $('<a rel="gallery">')
    						.append( img )
    						.prop('href', url + '_b.jpg')
    						.appendTo(gallery);
    			// lazy show the photos one by one
    			img.on('load', function(e){
    				setTimeout( function(){ link.addClass('loaded'); }, 20*index);
    			});
            });
    		
    		// finally, initialize photobox on all retrieved images
    		$('#gallery').find('a').photobox({ thumbs:true });
        });
    but I am not getting anything except this error message:

    Error: TypeError: e is undefined
    Source File: http://ajax.googleapis.com/ajax/libs.../jquery.min.js
    Line: 2


    I am new in javascript so am bit confused. What am I doing wrong? this exampe works for flickr.interestingness.getList, but not for my case.
    thanks in advance.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •