Facebook Integration

Status
Not open for further replies.

Axehack

In Runtime
Messages
110
Location
http:\\www
Ok folks... iv been scratchin my head about this one for about 2 months and im starting to go bald!
I have all the code I need to pull my facebook statuses through and display them on my website... But the way I am doing it is by using manually generated access tokens... this is no use atall as they expire every two hours....

I thought i finally crached it when i found an option under the advanced tab where I could disable depreciation of offline_access

This worked for about 7 hours... then stopped... offline_access my ass....
I figured 7 hours maybe wasnt too bad, if I could create some script to automatically generate one and insert it into my database every now and again... but when i created a 2nd offline_access token it expired after about 3 minutes....

Now here is the main point... I can generate an access token using:

https://graph.facebook.com/oauth/access_token?client_id=APP_ID_HERE&client_secret=APP_SECRET_HERE&grant_type=client_credentials

But this gives me an access token in the following format:
access_token=226944432768011|TTUed8-Y6xBR0t_JVABB39HNr4c

Whereas the access tokens required are in this format:
AAAEsx4DzZCS0BAMEE2g1zomDkiBYApnfHgzm0G8kRBKavyZAiuNFhOY1ygdONf98CMlr0nnafioSkZB7uQatdsQUCVyibiRfm4qGuxJcAZBZD

I can get the above token using the following URL:https://graph.facebook.com/oauth/au...read_stream,offline_access&type=user_agentBUT...
This outputs the access token into the address of the page i am redirected to... and also the user must be logged into MY FACEBOOK account to retrieve the token... None of which is useful...If anybody has any info on this... please help... Facebook developers seem to change everything so often and dont document anything very well :(On a final note... I see facebook offer badges now... But the status badge I create only shows a small part of the last status... If you know of any way to show a full status and preferably at least 5 statuses... This could be a much simpler solution.
 
the link below is the first relevant resource i could find relating to this topic. i'm surprised that i cant find a video or tutorial on how to do this. the link below show code in php that will be able to post status updates and photos to the visitors profile. you would have to look into the graph api to find what graph object member displays status updates. if you do this, please post it here cus id like to know too.

it seems the access token is a auth measure linking the visitor to fb. AFAIK, right now, fb wont allow visitors to access content from their site if the visitor doesnt login to fb. im thinking once they login, they get a access token. you need that access token and use it to pull data from fb. once again, im thinkin fb wont allow visitor to pull data without logging in.

it makes sense that that access token expires. it expires when the user logs out.

see if the link below makes sense to you and helps you achieve your goals. Best of Luck to ya!

Integrating with Facebook Graph API » phpmaster
 
Ok I have it working for now. I used a new token at about 6pm tonight, its now 2:20am and still working... Hopefully it will continue to work and I will be able to post my findings up here... else... back to the drawing board.

hmm...

IF $success = 1 {
POST $findings
} ELSE {
GOTO 1
}

lol
 
Status
Not open for further replies.
Back
Top Bottom