Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |