Question

In: Computer Science

Write a JQuery Ajax program which can communicate with flicker to get the last pictures taken...

  1. Write a JQuery Ajax program which can communicate with flicker to get the last pictures taken from any place or related to any concept(s) the user has written in a textbox, say Sydney, train. Some information associated with the image like its topic, time taken, and its link needs to be appeared with it.

  1. Develop a server which can serve the file you developed in 3-4.

  1. Add a plugin to the real jQuery library so that when you pass an array of elements to it, the function can move the elements forward and backward repeatedly. Then test your plugin by sending an array of images to it.

Solutions

Expert Solution

we can use jquery Ajax with flicker to get the picture taken from any place by the API method. flicker API is available for non commercial issue by the outside developers.some of the API methods we can use are

activity

flickr.activity.userComments flickr.activity.userPhotos  

auth

flickr.auth.checkToken flickr.auth.getFrob flickr.auth.getFullToken flickr.auth.getToken

auth.oauth flickr.auth.oauth.checkToken flickr.auth.oauth.getAccessToken

blogs flickr.blogs.getList flickr.blogs.getServices flickr.blogs.postPhoto  

and many other methods are there in the provided link.

https://www.flickr.com/services/api/

We API of Ficker is "flickr.collections.getInfo" as link "https://www.flickr.com

/services/api/flickr.collections.getInfo.html" which will provide info about the image but under the privacy rule.

before this, you need to SignUP on flicker as a developer in the given link above then, they provide you access token which is helping to secure data transferring and authentication purpose to access it.

Afterwards, you have to create code which is can communicate with Ficker. as I have shown below according to given requirements of JQuery with Ajax. Place of search.

​var flickerAPI = "https://api.flickr.com/services/feeds/photos_public.gne?format=json&tags=" + $("#search").val();
$.ajax({
url: flickerAPI,
dataType: "jsonp", // jsonp
jsonpCallback: 'jsonFlickrFeed', // add this property
success: function (result, status, xhr) {
$.each(result.items, function (i, item) {
$("<img>").attr("src", item.media.m).appendTo("#outputDiv");
if (i === 5) {
return false;
}
});
},
error: function (xhr, status, error) {
console.log(xhr)
$("#outputDiv").html("Result: " + status + " " + error + " " + xhr.status + " " + xhr.statusText)
}
});

​

if You want to implement as function then

function JavaScriptFetch() {
var script = document.createElement('script');
script.src = "https://api.flickr.com/services/feeds/photos_public.gne?format=json&tags=" + document.getElementById("search").value;;
document.querySelector('head').appendChild(script);
}
function jsonFlickrFeed(data) {
var image = "";
data.items.forEach(function (element) {
image += "<img src=\"" + element.media.m + "\"/>";
});
document.getElementById("outputDiv").innerHTML = image;
}

Related Solutions

Use HTML&CSS& JavaScript to: 3-4) Write a JQuery Ajax program which can communicate with flicker to...
Use HTML&CSS& JavaScript to: 3-4) Write a JQuery Ajax program which can communicate with flicker to get the last pictures taken from any place or related to any concept(s) the user has written in a textbox, say Sydney, train. Some information associated with the image like its topic, time taken, and its link needs to be appeared with it. 3-5) Develop a server which can serve the file you developed in 3-4. 3-6) Add a plugin to the real jQuery...
Write a function that uses jQuery Ajax to load a link instead of a button. Similar...
Write a function that uses jQuery Ajax to load a link instead of a button. Similar to this example. https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load But then it designates which chunk of text is shown based on which link is clicked based on id's. For example; Pseudocode: loaded file "txtfile.html" contains <body> id = red <p> *chunck of text* <p> id = blue <p> *chunk of text* <p> id = green <p> *chunk of text* <p> </body> Do this but with links with ids. So...
Write a program called listful.py, in which the user inputs names, which get added to a...
Write a program called listful.py, in which the user inputs names, which get added to a list. Your program should: · Include a comment in the first line with your name. · Include comments describing each major section of code. · Create a list. · Ask the user to input a first name or hit enter to end the list. · If the user adds a first name (i.e., anything other than a blank value): o Add the name to...
To get some practice with recursion. You can do all this in one driver program. Write...
To get some practice with recursion. You can do all this in one driver program. Write a recursive method to compute the result of the Fibonacci sequence: Fibonacci(N) = Fibonacci(N -1) + Fibonacci(N-2) N == 0 is 0 N == 1 is 1 Testing: Display the result for Fibonacci(N) and the number of function calls for N = 2, 5 and 10.
Write a program of linked list in which in which element can be inserted only at...
Write a program of linked list in which in which element can be inserted only at the end of the linked list and deletion can also take place at the end. Code needed in java.
Program must be in C++! Write a program which: Write a program which uses the following...
Program must be in C++! Write a program which: Write a program which uses the following arrays: empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7. Hours: an array of seven integers to hold the number of hours worked by each employee. payRate: an array of seven doubles to hold each employee’s hourly pay rate. Wages: an array of seven doubles to...
Program must be in C Write a program that allows the user to enter the last...
Program must be in C Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate in two different arrays. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. Example (Letters and numbers with underscore indicate an input):...
Write a program that is capable of detecting the color brown in an image taken by...
Write a program that is capable of detecting the color brown in an image taken by a webcam using OpenCV python code.
Write C18 program to get bit RB3 and send it to RC2.
Write C18 program to get bit RB3 and send it to RC2.
Write a Java program for slidsender and slidreiver 1. Start the program 2. Get the frame...
Write a Java program for slidsender and slidreiver 1. Start the program 2. Get the frame size from the user 3. To create the frame based on the user 4. To send frames to server from the client 5. If your frames reach the server it will send ACK signal to client otherwise it will send NACK signal to 6. Stop the program
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT