Umer Pasha Blogs

www.umerpasha.com

VB Source Code to get facebook status messages using Graph API

You will need an authentication token from facebook to access it. Please check apps.facebook.com for that. Again, you will have to create an app and get an authentication token generated with the correct rights.


        url = "https://graph.facebook.com/me/statuses?fields=id,message&limit=50&offset=0&access_token=" & sToken

        strJSON = get_page_contents( URL ) 

        set user = JSON.parse( strJSON )
 

                    TmpVal=user.data.get(FBScounter).id
                    If TmpVal=OldVal then
                        ErrFlag=1
                        exit do
                    End If
'                        FBStatus2 = cdate(left(user.data.get(FBScounter).updated_time,10) & " " & mid(user.data.get(FBScounter).updated_time,12,5)) & ": " & user.data.get(FBScounter).message 
                        response.write "<li><span>" & cdate(left(user.data.get(FBScounter).updated_time,10) & " " & mid(user.data.get(FBScounter).updated_time,12,5)) & "</span><a href='#'>" & user.data.get(FBScounter).message  & "</a></li>"

3 Comments »