<commit_before>
// Asynchronous Flickr Search
//
// Flickr reveals a searchable JSON Feed you can access via jQuery's $.getJSON()
// method. Use this to allow users to search for a tag or comma-separated list
// of tags and view the images that are found.
//
// Allow users to click the images to see a larger version with more information.
$(document).on('ready', function(){

	var searchImages = function(tags){
		var flickrAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
		console.log (tags);
		$.getJSON( flickrAPI, {
   			 tags: tags,
   			 tagmode: "any",
    		format: "json"
		}).done(function( data ) {
			$("#images").empty();
    		$.each( data.items, function( i, item ) {
				var newItem = $("<li>");
				newItem.appendTo("#images");
        		$( "<img>" ).attr( "src", item.media.m ).appendTo( newItem );
				$('h1.search-title').first()[0].innerHTML = "Search for: " + tags;
    
       			var newTitle = $('<p class="image-title">').html(item.title).appendTo(newItem);
       			var newDate = $('<p class="image-date">').text(item.date_taken).appendTo(newItem);
        		var newLink = $('<a>').attr('href', item.link).text('View on Flickr.').appendTo(newItem);
        		if ( i === 15 ) {
        			return false;
        		}
      	    });
    	});	
<commit_msg>added documentation to JS file<commit_after>
// Asynchronous Flickr Search
//
// Flickr reveals a searchable JSON Feed you can access via jQuery's $.getJSON()
// method. Use this to allow users to search for a tag or comma-separated list
// of tags and view the images that are found.
//
// Allow users to click the images to see a larger version with more information.
$(document).on('ready', function(){
//this
	var searchImages = function(tags){
		var flickrAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
		console.log (tags);
		//I included a colsole.log here to make sure that the user input was loading correctly
		$.getJSON( flickrAPI, {
			//Iquery example about <NAME> but with tags switched to be open to user input
   			 tags: tags,
   			 tagmode: "any",
    		format: "json"
			//the done function in jQuery is for when the json  call is successful
		}).done(function( data ) {
			//.empty clears out the page, so a new search won't load images after the previous images
			$("#images").empty();
    		$.each( data.items, function( i, item ) {
				//this creates a new <li> for each new image
				var newItem = $("<li>");
				newItem.appendTo("#images");
        		$( "<img>" ).attr( "src", item.media.m ).appendTo( newItem );
				//this changes the html to reflect the search input of the user
				$('h1.search-title').first()[0].innerHTML = "Search for: " + tags;
    //this adds the title/date/link to each image
       			var newTitle = $('<p class="image-title">').html(item.title).appendTo(newItem);
       			var newDate = $('<p class="image-date">').text(item.date_taken).appendTo(newItem);
        		var newLink = $('<a>').attr('href', item.link).text('View on Flickr.').appendTo(newItem);
				// this is my limit on the number of images I'd like loaded onto the page
        		if ( i === 15 ) {
        			return false;
        		}
      	    });
    	});	

{'fraction_non_alphanumeric': 0.15406075635461872, 'fraction_numerical': 0.0024798512089274642, 'mean_word_length': 2.860047846889952, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '4059947', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1002, 'n_words': 330}