0

I am pretty new to JS. I am looking for a high-res profile picture of Facebooks users using FB Graph API.

The following code:

var pictureData = $http.get("https://graph.facebook.com/< Facebook profile ID >/picture?type=large&redirect=0&width=400");

delivers a JSON like:

{
   "data": {
      "height": 480,
      "is_silhouette": false,
      "url": "https://fbcdn-profile-a.akamaihd.net/...",
      "width": 480
   }
}

How do I extract the value of 'url' out of this?

Many thanks! :)

leppie
  • 115,091
  • 17
  • 196
  • 297
Chris777
  • 1
  • 1

1 Answers1

2

Easy one:

var pictureURL = pictureData.data.url;
Tobi
  • 31,405
  • 8
  • 58
  • 90