Net Effect
Net Effect

Reputation: 1

Posting using Curl and php link error

I'm having issues posting to facebook using php & cURL I have posted my code to pastebin

http://pastebin.com/pQdXq0Pi

The link is the issue. If I use the google shortened url the post doesn't show on the feed. If I change to the long url the post will show.

confused...

obviously I have removed the access token and changed the other variables to just names.

any help would be appreciated.

Thanks

Upvotes: 0

Views: 132

Answers (2)

Luca Rocchi
Luca Rocchi

Reputation: 6484

i guess the problem is that the short url involve a redirect ... try add

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); to follow the redirect

Upvotes: 0

phwd
phwd

Reputation: 19995

Facebook needs to be able to follow through the redirect if it cannot, then no data will be scraped.

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fgoo.gl%2FJ2fwI

As opposed to

https://developers.facebook.com/tools/debug/og/object?q=bit.ly%2F169bOjM

Upvotes: 1

Related Questions