<commit_before>﻿

var photoFeedServices = angular.module('photoFeedServices', ['ngResource']);

photoFeedServices.factory('flickrPhotosService', ['$resource', function ($resource) {
    var flickrPhotoClass = {};

    var publicPhotoBaseUrl = 'https://api.flickr.com/services/rest/';

    var api_key = '<KEY>';

    var photosData = $resource(publicPhotoBaseUrl, { method: 'flickr.photos.search', api_key: api_key, tag_mode: 'all', per_page: '20', extras: 'date_upload,owner_name', tags: 'potato', format: 'json', nojsoncallback: '1' }, {
        get: { method: 'GET',cache:true}
    });

    var photoDataById = $resource(publicPhotoBaseUrl, { method: 'flickr.photos.getInfo', api_key: api_key, format: 'json', nojsoncallback: '1' });

    //variable to maintain a count of the next page load
    flickrPhotoClass.pageToLoad = 2;

    //function to get photo list
    flickrPhotoClass.getPhotos = function (params, callback) { 
        return photosData.get(params, callback);
    }

    //function to get photo information by id
    flickrPhotoClass.getPhotoById = function (id, callback) {
        return photoDataById.get({ photo_id: id }, callback);
    }

    return flickrPhotoClass;
<commit_msg>updated caching<commit_after>﻿

var photoFeedServices = angular.module('photoFeedServices', ['ngResource']);

photoFeedServices.factory('flickrPhotosService', ['$resource', function ($resource) {
    var flickrPhotoClass = {};

    var publicPhotoBaseUrl = 'https://api.flickr.com/services/rest/';

    var api_key = '<KEY>';

    var photosData = $resource(publicPhotoBaseUrl, { method: 'flickr.photos.search', api_key: api_key, tag_mode: 'all', per_page: '20', extras: 'date_upload,owner_name', tags: 'potato', format: 'json', nojsoncallback: '1' }, {
        get: { method: 'GET',cache:true}
    });

    var photoDataById = $resource(publicPhotoBaseUrl, {
        method: 'flickr.photos.getInfo', api_key: api_key, format: 'json', nojsoncallback: '1'
    }, {
        get: { method: 'GET', cache: true }
    });

    //variable to maintain a count of the next page load
    flickrPhotoClass.pageToLoad = 2;

    //function to get photo list
    flickrPhotoClass.getPhotos = function (params, callback) { 
        return photosData.get(params, callback);
    }

    //function to get photo information by id
    flickrPhotoClass.getPhotoById = function (id, callback) {
        return photoDataById.get({ photo_id: id }, callback);
    }

    return flickrPhotoClass;

{'fraction_non_alphanumeric': 0.13616161616161615, 'fraction_numerical': 0.00404040404040404, 'mean_word_length': 3.9224652087475147, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '294637', 'n_tokens_mistral': 781, 'n_tokens_neox': 739, 'n_words': 190}