Facebook graph API, access location tags in photos and posts - facebook-graph-api

On photos and posts I often see location tags pointing to a Facebook page representing a place. They are typically prepended by "near" , "at" or "in". Does anybody know of a way to access this data via the graph API or any other way?
Here is an example :
webpage, I made the photo public so everyone can see http://www.facebook.com/photo.php?pid=11671735&id=506482094
api call https://graph.facebook.com/10150601497547095?access_token=*
{
"id": "10150601497547095",
"from": {
"name": "Edouard Tabet",
"id": "506482094"
},
"name": "Alcohol grows on trees in Isabela, Galapagos",
"picture": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg",
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg",
"height": 720,
"width": 479,
"images": [
{
"height": 2048,
"width": 1365,
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/329294_10150601497547095_506482094_11671735_110244218_o.jpg"
},
{
"height": 720,
"width": 479,
"source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg"
},
{
"height": 270,
"width": 180,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_a.jpg"
},
{
"height": 130,
"width": 86,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg"
},
{
"height": 112,
"width": 75,
"source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_t.jpg"
}
],
"link": "http://www.facebook.com/photo.php?pid=11671735&id=506482094",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2012-01-16T23:34:54+0000",
"position": 1,
"updated_time": "2012-01-21T02:16:55+0000",
"comments": {
"data": [
{
"id": "10150601497547095_7207114",
"from": {
"name": "Tom LeNoble",
"id": "218686"
},
"message": "hope you are having fun!",
"can_remove": true,
"created_time": "2012-01-16T23:36:33+0000"
},
{
"id": "10150601497547095_7207963",
"from": {
"name": "Sol McKinney",
"id": "1021642751"
},
"message": "How come Darwin didn't write about that?!",
"can_remove": true,
"created_time": "2012-01-17T01:31:39+0000"
},
{
"id": "10150601497547095_7212820",
"from": {
"name": "Romain BL",
"id": "556337447"
},
"message": "Des bisous mr Tabet! J'esp\u00e8re que tu vas bien depuis tout ce temps!",
"can_remove": true,
"created_time": "2012-01-17T18:19:13+0000"
}
],
"paging": {
"next": "https://graph.facebook.com/10150601497547095/comments?access_token="
}
},
"likes": {
"data": [
{
"id": "1404245",
"name": "Hannah Russin"
},
{
"id": "1278210658",
"name": "Seth Long"
},
{
"id": "218686",
"name": "Tom LeNoble"
}
],
"paging": {
"next": "https://graph.facebook.com/10150601497547095/likes?access_token=&limit=25&offset=25&__after_id=218686"
}
}
}

I figured it out... When accessing a photo with the "photo id" the place attribute is not present in the result... when accessing the same photo through its "post id" then the place attribute appears in the JSON result of the GRAPH API call. Not very convenient...

They should all have place:
https://developers.facebook.com/tools/explorer?method=GET&path=15500414_689594654776

Related

Is there a minimum confidence for celebrity detection in microsoft cognitive services api?

All the confidences I've seen for celebrity detection has been very high. Is there some minimum confidence threshold for which the API will not consider a celebrity present?
The API will return an empty or null "celebrities" JSON array if it doesn't recognize a celebrity and will only return a populated "celebrities" JSON array if the "confidence" level is above 0.
Here's an examples running 2 pictures of Michael Jackson through the celebrities and landmarks section in the Computer Vision API page:
Michael Jackson is recognized and a populated "celebrities" JSON array is returned
{
"categories": [
{
"name": "people_portrait",
"score": 0.62109375,
"detail": {
"celebrities": [
{
"name": "Michael Jackson",
"faceRectangle": {
"left": 377,
"top": 282,
"width": 381,
"height": 381
},
"confidence": 0.99902832508087158
}
],
"landmarks": null
}
}
],
"adult": null,
"tags": [
{
"name": "person",
"confidence": 0.99581664800643921
}
],
"description": {
"tags": [
"person",
"man",
"young",
"standing",
"looking",
"front",
"holding",
"wearing",
"shirt",
"posing",
"boy",
"white",
"smiling",
"dark",
"black",
"table",
"large",
"suit",
"woman",
"board"
],
"captions": [
{
"text": "Michael Jackson posing for the camera",
"confidence": 0.91584373926593021
}
]
},
"requestId": "ac41aa84-9a70-4ffc-8de4-5a662600fc56",
"metadata": {
"width": 1000,
"height": 1000,
"format": "Jpeg"
},
"faces": [
{
"age": 31,
"gender": "Male",
"faceRectangle": {
"left": 377,
"top": 282,
"width": 381,
"height": 381
}
}
],
"color": {
"dominantColorForeground": "White",
"dominantColorBackground": "Black",
"dominantColors": [
"Black",
"White"
],
"accentColor": "B64215",
"isBWImg": false
},
"imageType": {
"clipArtType": 0,
"lineDrawingType": 0
}
}
Michael Jackson is not recognized and an empty "celebrities" JSON array is returned
{
"categories": [
{
"name": "people_",
"score": 0.94140625,
"detail": {
"celebrities": [],
"landmarks": null
}
}
],
"adult": null,
"tags": [
{
"name": "person",
"confidence": 0.99912232160568237
},
{
"name": "outdoor",
"confidence": 0.936089813709259
}
],
"description": {
"tags": [
"person",
"outdoor",
"man",
"woman",
"standing",
"front",
"suit",
"holding",
"car",
"wearing",
"people",
"couple",
"posing",
"young",
"bus",
"black",
"smiling",
"glasses",
"umbrella",
"group",
"table",
"city",
"red",
"water",
"street",
"phone",
"boat",
"train"
],
"captions": [
{
"text": "a couple of people posing for the camera",
"confidence": 0.86922603629725859
}
]
},
"requestId": "7d57493c-f8b0-468f-8135-17da555d2463",
"metadata": {
"width": 1000,
"height": 1000,
"format": "Jpeg"
},
"faces": [
{
"age": 38,
"gender": "Female",
"faceRectangle": {
"left": 400,
"top": 270,
"width": 234,
"height": 234
}
}
],
"color": {
"dominantColorForeground": "Black",
"dominantColorBackground": "Black",
"dominantColors": [
"Black",
"Grey"
],
"accentColor": "364E5D",
"isBWImg": false
},
"imageType": {
"clipArtType": 0,
"lineDrawingType": 0
}
}

Amazon Rekognition for Video - getFaceSearch: index number

I’m new using Amazon Rekognition to analyze faces on a video.
I’m using startFaceSearch to start my analysis. After the job is completed successfully, I’m using the JobId generated to call getFaceSearch.
On my first video analyzed, the results were as expected. But when I analyze the second example some strange behavior occurs and I can’t understand why.
Viewing the JSON generated as results for my second video, completely different faces are identified with the same index number.
Please see the results below.
{
"Timestamp": 35960,
"Person": {
"Index": 11,
"BoundingBox": {
"Width": 0.09375,
"Height": 0.24583333730698,
"Left": 0.1875,
"Top": 0.375
},
"Face": {
"BoundingBox": {
"Width": 0.06993006914854,
"Height": 0.10256410390139,
"Left": 0.24475525319576,
"Top": 0.375
},
"Landmarks": [
{
"Type": "eyeLeft",
"X": 0.26899611949921,
"Y": 0.40649232268333
},
{
"Type": "eyeRight",
"X": 0.28330621123314,
"Y": 0.41610333323479
},
{
"Type": "nose",
"X": 0.27063181996346,
"Y": 0.43293061852455
},
{
"Type": "mouthLeft",
"X": 0.25983560085297,
"Y": 0.44362303614616
},
{
"Type": "mouthRight",
"X": 0.27296212315559,
"Y": 0.44758656620979
}
],
"Pose": {
"Roll": 22.106262207031,
"Yaw": 6.3516845703125,
"Pitch": -6.2676968574524
},
"Quality": {
"Brightness": 41.875026702881,
"Sharpness": 65.948883056641
},
"Confidence": 90.114051818848
}
}
}
{
"Timestamp": 46520,
"Person": {
"Index": 11,
"BoundingBox": {
"Width": 0.19034090638161,
"Height": 0.42083331942558,
"Left": 0.30681818723679,
"Top": 0.17916665971279
},
"Face": {
"BoundingBox": {
"Width": 0.076486013829708,
"Height": 0.11217948794365,
"Left": 0.38680067658424,
"Top": 0.26923078298569
},
"Landmarks": [
{
"Type": "eyeLeft",
"X": 0.40642243623734,
"Y": 0.32347011566162
},
{
"Type": "eyeRight",
"X": 0.43237379193306,
"Y": 0.32369664311409
},
{
"Type": "nose",
"X": 0.42121160030365,
"Y": 0.34618207812309
},
{
"Type": "mouthLeft",
"X": 0.41044121980667,
"Y": 0.36520344018936
},
{
"Type": "mouthRight",
"X": 0.43202903866768,
"Y": 0.36483728885651
}
],
"Pose": {
"Roll": 0.3165397644043,
"Yaw": 2.038902759552,
"Pitch": -1.9931464195251
},
"Quality": {
"Brightness": 54.697460174561,
"Sharpness": 53.806159973145
},
"Confidence": 95.216400146484
}
}
}
In fact, in this video, all faces have the same index number, regardless of they are different. Any suggestions?
PersonDetail object is the result of the API . "index" is the identifier for the person detected in the video. So the index doesn't span across videos. It is just an internal reference.
Link below which details Index
https://docs.aws.amazon.com/rekognition/latest/dg/API_PersonDetail.html

CouchDB-Why my rerduce is always coming as false ? I am not able to reduce anything properly

I am new to CouchDB. I have a 9 gb dataset loaded into my couchdb. I am able to map everything correctly. But I cannot reduce any of the results using the code written in the reduce column. When i tried log, log shows that rereduce values as false. Do i need to do anything special while doing the Map() or how to set the rereduce value is TRUE??
A sample of my data is as follows:
{
"_id": "33d4d945613344f13a3ee92933b160bf",
"_rev": "1-0425ca93e3aa939dff46dd51c3ab86f2",
"release": {
"genres": {
"genre": "Electronic"
},
"status": "Accepted",
"videos": {
"video": [
{
"title": "[1995] bola - krak jakomo",
"duration": 349,
"description": "[1995] bola - krak jakomo",
"src": "http://www.youtube.com/watch?v=KrELXoYThpI",
"embed": true
},
{
"title": "Bola - Forcasa 3",
"duration": 325,
"description": "Bola - Forcasa 3",
"src": "http://www.youtube.com/watch?v=Lz9itUo5xtc",
"embed": true
},
{
"title": "Bola (Darrell Fitton) - Metalurg (MV)",
"duration": 439,
"description": "Bola (Darrell Fitton) - Metalurg (MV)",
"src": "http://www.youtube.com/watch?v=_MYpOOMRAeQ",
"embed": true
}
]
},
"labels": {
"label": {
"catno": "SKA005",
"name": "Skam"
}
},
"companies": "",
"styles": {
"style": [
"Downtempo",
"Experimental",
"Ambient"
]
},
"formats": {
"format": {
"text": "",
"name": "Vinyl",
"qty": 1,
"descriptions": {
"description": [
"12\"",
"Limited Edition",
"33 ⅓ RPM"
]
}
}
},
"country": "UK",
"id": 1928,
"released": "1995-00-00",
"artists": {
"artist": {
"id": 390,
"anv": "",
"name": "Bola",
"role": "",
"tracks": "",
"join": ""
}
},
"title": 1,
"master_id": 13562,
"tracklist": {
"track": [
{
"position": "A1",
"duration": "4:33",
"title": "Forcasa 3"
},
{
"position": "A2",
"duration": "5:48",
"title": "Krak Jakomo"
},
{
"position": "B1",
"duration": "7:50",
"title": "Metalurg 2"
},
{
"position": "B2",
"duration": "6:40",
"title": "Balloom"
}
]
},
"data_quality": "Correct",
"extraartists": {
"artist": {
"id": 388200,
"anv": "",
"name": "Paul Solomons",
"role": "Mastered By",
"tracks": "",
"join": ""
}
},
"notes": "Limited to 480 copies.\nA1 is a shorter version than that found on the 'Soup' LP.\nA2 ends in a lock groove."
}
}
My intention is to count the mapped values. My mapping function is as follows:
function(doc){
if(doc.release)
emit(doc.release.title,1)
}
Map results shows around 5800 results
I want to use the following functions in the reduce tab to count:
Reduce:
_count or _sum
It does not give single rounded value. Even i cannot get the simple _count operations right !!! :(
for screenshot,
Please help me !!!
What you got was the sum of values per title. What you wanted, was the sum of values in general.
Change the grouping drop-down list to none.
Check CouchdDB's wiki for more details on grouping.

Facebook Graph Api: Unable to get latest post for keywords

Can anyone help me, When I request using link
https://graph.facebook.com/search?&limit=2&until=now&q=hi&type=post&access_token=AAAAAAITEghMBAIScEzst3h5VpV8pKZA7di2ZC3czxr5
Note: I am not giving valid token for security reason.
I always get the result for 27 Nov 2012, while I tried to search for latest post. Am I missing something? Please help.
Thanks in Advance.
RESULT I get:
{
"data": [
{
"id": "730221920_10151138508071921",
"from": {
"name": "Pinky Saowichit",
"id": "730221920"
},
"message": "\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c\u0e19\u0e35\u0e49\u0e2d\u0e32\u0e08\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e2d\u0e2d\u0e31\u0e19\u0e1a\u0e48\u0e2d\u0e22\u0e46 \u0e19\u0e30\u0e04\u0e30 \u0e41\u0e1f\u0e19\u0e04\u0e25\u0e31\u0e1a \u0e43\u0e2b\u0e49\u0e23\u0e39\u0e49\u0e27\u0e48\u0e48\u0e32\u0e04\u0e34\u0e14\u0e16\u0e36\u0e07\u0e19\u0e30\u0e04\u0e30 \u0e41\u0e15\u0e48\u0e15\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e40\u0e23\u0e32\u0e01\u0e33\u0e25\u0e31\u0e07\u0e04\u0e34\u0e14\u0e16\u0e36\u0e07\u0e04\u0e38\u0e13 \u0e04\u0e32\u0e19\u0e18\u0e35\u0e41\u0e25\u0e30\u0e40\u0e17\u0e40\u0e23\u0e0b\u0e48\u0e32\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e21\u0e32\u0e01\u0e46 \u0e2b\u0e38 \u0e2b\u0e38",
"privacy": {
"value": ""
},
"type": "status",
"status_type": "mobile_status_update",
"created_time": "2012-11-27T03:12:32+0000",
"updated_time": "2012-11-27T07:44:54+0000",
"likes": {
"data": [
{
"name": "Weniefredo Laud",
"id": "100004751890183"
},
{
"name": "\u0e1e\u0e23\u0e15 \u0e1c\u0e25\u0e14\u0e35",
"id": "100001056963372"
},
{
"name": "\u0e08\u0e23\u0e34\u0e0d\u0e32 \u0e25\u0e2d\u0e27",
"id": "100000046347271"
},
{
"name": "Noolek Tikamborn",
"id": "100003048464258"
}
],
"count": 6
}
},
{
"id": "100003971930240_283727615063091",
"from": {
"name": "Mariana Salcedo",
"id": "100003971930240"
},
"story": "Mariana Salcedo shared a link.",
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQASxQms6c0xFkdO&w=90&h=90&url=http\u00253A\u00252F\u00252Fask.fm\u00252Fimages\u00252F50x50.gif",
"link": "http://ask.fm/marianasalcedo/answer/15735435637",
"name": "CRUSH hi",
"caption": "jajajajaja que enfadosa erees!",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yN/x/aS8ecmYRys0.gif",
"privacy": {
"value": ""
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Ask.fm",
"id": "129215213762342"
},
"created_time": "2012-11-27T03:11:38+0000",
"updated_time": "2012-11-27T03:11:38+0000"
}
],
"paging": {
"previous": "https://graph.facebook.com/search?q=hi&limit=2&type=post&access_token=AAAAAAITEghMBAIScEzst3h5VpV8pKZA7di2ZC3czxr5ANnvKPPc1wqYJJZAANd9PI0NKLX5Xk5ReRX3T01iim8BoJp6r16itU8vPxRP&since=1353985952&__previous=1",
"next": "https://graph.facebook.com/search?q=hi&limit=2&type=post&access_token=AAAAAAITEghMBAIScEzst3h5VpV8pKZA7di2ZC3czxr5ANnvKPPc1wqYJJZAANd9PI0NKLX5Xk5ReRX3T01iim8Bo&until=1353985897"
}
}

Why application posts on my wall marked as links?

My application creates posts on user's wall, but it's marked as link.
I see that other applications doing same thing but for some reason facebook don't mark their posts as links. Tried to find the difference between them and me in graph api explorer, and the only difference is status_type attribute (this is not even documented). Mine set to "shared_story" and in other applications is "app_created_story". Tried to set it manualy but facebook still use shared_story even if I set it to app_created_story
Data from graph api explorer (first is my application)
[{
"id": "100001302536317_168939309896943",
"from": {
"name": "Андрей Реаскович",
"id": "100001302536317"
},
"story": "Андрей Реаскович shared a link.",
"story_tags": {
"0": [
{
"id": "100001302536317",
"name": "Андрей Реаскович",
"offset": 0,
"length": 16,
"type": "user"
}
]
},
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQBcrRQnipKHB6g6&w=90&h=90&url=http%3A%2F%2Fstatic.jackpotrush.com%2Fimages%2Fviral%2Fgames%2Fjoker_jester.png",
"link": "http://apps.facebook.com/jackrush/?ref=bonus-game",
"name": "I Won Big on a Bonus Round at Jackpot Rush!",
"caption": " ",
"description": "I Just Won 200 Coins at a Jackpot Rush Bonus Round and it Feels Amazing!",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100001302536317/posts/168939309896943"
},
{
"name": "Like",
"link": "http://www.facebook.com/100001302536317/posts/168939309896943"
}
],
"privacy": {
"description": "Only Me",
"value": "SELF"
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Jackrush Development",
"namespace": "jackrush",
"id": "434595133235542"
},
"created_time": "2012-11-12T08:48:18+0000",
"updated_time": "2012-11-12T08:48:18+0000",
"comments": {
"count": 0
}
},
{
"id": "100001302536317_420171444702936",
"from": {
"name": "Андрей Реаскович",
"id": "100001302536317"
},
"picture": "http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=242829452408559&v=1&size=z&cksum=cd0fa7a15202d05700bf1464fd989d42&src=http%3A%2F%2Fc.cdn.blueshellgames.com%2Fs%2F%3Aac05b878%2Fmonte%2Fi%2Ffeed_story_image-logo_black.png",
"link": "http://apps.facebook.com/luckyslotsgame/?action=shareLevelUpReward&posterID=fb%3A100001302536317&k_utag=df3f4636aabab65e&levelUpToken=6553%3AsVFCJmW43zW_Nni9vBB9xg%3D%3D&level=4&refID=fb%3A100001302536317&utm_medium=viral&utm_source=levelUp",
"name": "First 5 Clickers get 150 Free Coins!",
"caption": "Андрей just reached level 4 and is giving away 150 Free Coins to celebrate!",
"description": "Play the best slots on Facebook! Get free chips daily! Unlock new slot machines and new bonus games! Don't miss out, play now!",
"icon": "http://photos-d.ak.fbcdn.net/photos-ak-snc7/v85006/51/242829452408559/app_2_242829452408559_9481.gif",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100001302536317/posts/420171444702936"
},
{
"name": "Like",
"link": "http://www.facebook.com/100001302536317/posts/420171444702936"
},
{
"name": "Claim BONUS Coins",
"link": "http://apps.facebook.com/luckyslotsgame/?action=shareLevelUpReward&posterID=fb%3A100001302536317&k_utag=df3f4636aabab65e&levelUpToken=6553%3AsVFCJmW43zW_Nni9vBB9xg%3D%3D&level=4&refID=fb%3A100001302536317&utm_medium=viral&utm_source=levelUp"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE"
},
"type": "link",
"status_type": "app_created_story",
"application": {
"name": "Lucky Slots",
"namespace": "luckyslotsgame",
"id": "242829452408559"
},
"created_time": "2012-11-12T08:13:25+0000",
"updated_time": "2012-11-12T08:13:25+0000",
"comments": {
"count": 0
}
}]