Skip to content

Commit

Permalink
Working on Photos
Browse files Browse the repository at this point in the history
  • Loading branch information
rinkurock committed Dec 26, 2011
1 parent 5faf4ea commit 5f7e1c9
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions samples/photo/postComment.html
@@ -0,0 +1,67 @@
<h2>Post Photo Comment</h2>
<p>
Post Photo Comment<input type="button" value="Post Photo Comment" onclick="fetch();"/><br/><br/>
<pre class="js">
LightBulb.photos.postComment({
photoId: "Picture_ID"
message: ":)"
}, function(response) {

});
</pre>
</p>
<script type="text/javascript">
function fetch() {

var userData = LightBulb._getFacebookData();
var userId = userData.facebookUserId;

LightBulb.users.getPhotos({
user:userId
}, function (response) {
var picId = response.data[0].id;


alert("Picture Id = "+picId);


LightBulb.photos.getPhoto({
photoId: picId
}, function (response) {
console.log(response);
$("#result").html("<h2>Result - 1st Page</h2>")
var picUrl = response.picture;
$("#result").append('<img src='+ picUrl+' altr="My Facebook Image" title="My Facebook Image" />');


LightBulb.photos.getComments({
photoId: picId
},function(result){
console.log(result);
jQuery.each(result, function(index, data){
if(index === 'data'){
jQuery.each(data, function(x, val){
jQuery.each(val, function(y, message){
if(y === 'message'){
$("#result").append("<br/>"+message+"<br/>");
}
});
});
}

});
});

LightBulb.photos.postComment({
photoId: picId,
message: ":)"
}, function(data) {
console.log(data);
});


});

});
}
</script>

0 comments on commit 5f7e1c9

Please sign in to comment.