0

I wrote the next code:

var client = new FacebookClient();
string str, profile_name;

foreach (var myFriend in @Model.Friends.Data)
{
    str = myFriend.Link.ToString();
    profile_name = str.Substring(@str.LastIndexOf('/') + 1);
    dynamic me = client.Get(profile_name);
}

it passes all the links of my friends list (for example: http://www.facebook.com/mariah.carey.62), takes only the string after the last: / (in this case: mariah.carey.62), and gets the public information (gender, name, etc).

my problem is: there are few links that seems like: http://www.facebook.com/profile.php?id=0123456789. and then, profile_name is: profile.php?id=0123456789. assuming I success to send: client.Get("0123456789"). the graph of this user seems like:

"id": "0123456789",
"name": "\u05d0\u05e1\u05e0\u05ea \u05d0\u05d4\u05e8\u05d5\u05df",
"first_name": "\u05d0\u05e1\u05e0\u05ea",
"last_name": "\u05d0\u05d4\u05e8\u05d5\u05df",
"link": "https://www.facebook.com/people/\u05d0\u05e1\u05e0\u05ea-
\u05d0\u05d4\u05e8\u05d5\u05df/0123456789",
"gender": "female",

(the graph is found at: http://graph.facebook.com/0123456789)

how can I get understandable data of this user? the name that I got tells me nothing. maybe there is a way to decrypt it.

4

1 回答 1

1

我用了:

System.Text.RegularExpressions.Regex.Unescape(str);
于 2013-06-15T01:31:24.383 回答