Here is my code (look at the UCF for the ReplaceString function ... And the NetGetString is just a function that create a http connection and retrieves the result string (all in one func) ... :
Hope this helps
....
....
JSONData$=NetGetString("graph.facebook.com",fbID$+"/picture?redirect=false","",1)
URLPic$=GetStringToken( JSONData$, chr(34), 6 )
URLPic$=replaceString( URLPic$ , "\" , "" )
Protocol$=GetStringToken( URLPic$, "/", 1 )
FirstPartUrl$=GetStringToken( URLPic$, "/", 2 )
SecondPartUrl$=Right(URLPic$,len(URLPic$)-(len(Protocol$)+2+len(FirstPartUrl$))-1)
if Protocol$="https:" then SSL=1
if Protocol$="http:" then SSL=0
g_Net_Connection = CreateHTTPConnection ( )
g_Net_Connected = SetHTTPHost ( g_Net_Connection, FirstPartUrl$, SSL )
GetHTTPFile( g_Net_Connection, SecondPartUrl$, "/media/ProfilePicture/"+fbID$+".jpg" )
timeout# = timer() + 5
while GetHTTPFileComplete(g_Net_Connection)=0 and timer()<timeout#
sleep(1)
endwhile
DeleteHTTPConnection( g_Net_Connection )
.