Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (79 sloc) 2.32 KB
<html>
<style>
body {
min-width:357px;
overflow-x:hidden;
}
img {
margin:5px;
border:2px solid black;
vertical-align:middle;
width:75px;
height:75px;
}
</style>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
var req = new XMLHttpRequest();
req.open(
"GET",
"http://api.flickr.com/services/rest/?" +
"method=flickr.photos.search&" +
"api_key=90485e931f687a9b9c2a66bf58a3861a&" +
"text=hello%20world&" +
"safe_search=1&" + // 1 is "safe"
"content_type=1&" + // 1 is "photos only"
"sort=relevance&" + // another good one is "interestingness-desc"
"per_page=20",
true);
//req.onload = showPhotos;
//req.send(null);
function showPhotos() {
var photos = req.responseXML.getElementsByTagName("photo");
for (var i = 0, photo; photo = photos[i]; i++) {
var img = document.createElement("image");
img.src = constructImageURL(photo);
document.body.appendChild(img);
}
}
// See: http://www.flickr.com/services/api/misc.urls.html
function constructImageURL(photo) {
return "http://farm" + photo.getAttribute("farm") +
".static.flickr.com/" + photo.getAttribute("server") +
"/" + photo.getAttribute("id") +
"_" + photo.getAttribute("secret") +
"_s.jpg";
}
function getData(){
//alert("HI");
var x = document.getElementById("int");
//x.innerHTML += "<b>Loading Data...<b>";
var value = document.getElementById("email");
$.getJSON('http://localhost:18080/convertigo/projects/GmailpetProject/.jsonp?__sequence=callGmail&email=' + value.value + '&__callback=?', function(data) {
var d = document.getElementById("results");
//x.innerHTML = "<b>The Data is...<b>";
$.each(data.document.mailDetails.mail, function(){
if(this){
var x = document.getElementById("int");
d.innerHTML += "<br/>" + this.from;
$.each(this.links, function(i,val){
d.innerHTML += "<br/> <a target='_blank' href='https://mail.google.com" + val + "'>Click Here :)</a>";
});
}
else{
alert("here");
}
})
x.innerHTML = "";
});
}
</script>
<body>
Enter email id to search: <input type="text" value="" name="email" id="email"/> <br/>
<input type="button" name="getData" onclick="getData()" value="Get Attachment Links!"/>
<br/>
<br/>
<div id="int"/>
<div class="results" id="results"/>
</body>
</html>