Permalink
Browse files

Fixed errything

  • Loading branch information...
1 parent f2ca6f1 commit ca6aa6d3928a7149ffb575bdc5566429dd13b21d Akash Gupta committed Dec 6, 2011
Showing with 19 additions and 4 deletions.
  1. BIN website/accesses.db
  2. +19 −4 website/static/script.js
View
Binary file not shown.
View
@@ -24,14 +24,29 @@ function post(path, params, method) {
document.body.removeChild(form);
}
+function getProfilePicURL(id) {
+ return "https://www.facebook.com/" + id;
+}
+
function onReturn(urls, response) {
console.log(response);
var myDate = new Date();
var dateString = myDate.toString();
console.log(response.status);
- for (var photo in response.photos) {
- console.log(photo);
+ for (var photoIndex in response.photos) {
+ for (var tagIndex in response.photos[photoIndex]["tags"]) {
+ console.log(tagIndex);
+ recogUID = response.photos[photoIndex]["tags"][tagIndex]["uids"][0]["uid"];
+ recogUID = recogUID.substring(0, recogUID.length - 13);
+ var profilePicURL = getProfilePicURL(recogUID);
+ options = {
+ time : dateString,
+ photo : profilePicURL,
+ uid : recogUID
+ }
+ post("http://ghost.eecs.berkeley.edu:8888/add", options, "post");
+ }
}
}
@@ -45,8 +60,8 @@ function onAuthenticated(response) {
uids: "friends@facebook.com",
namespace: "facebook.com",
user_auth:
- "fb_user:" + uid + "," +
- "fb_oauth_token:" + response.authResponse.accessToken
+ "fb_user:" + uid + "," +
+ "fb_oauth_token:" + response.authResponse.accessToken
};
var apiKey = "24fa7980be31a5332723ce74780786e6";
var faceApi = new Face_ClientAPI(apiKey);

0 comments on commit ca6aa6d

Please sign in to comment.