0

I'm building a site which has amazon & other affiliates associated with it and I'd like to use the links on twitter, however the links on twitter are shortened using bitly. Is it possible to unshorten the link using php?

So for example, the full url may be:

http://www.mysite.com/unbit.php?url=<a href="https://rads.stackoverflow.com/amzn/click/com/B0049J4O0K" rel="nofollow noreferrer" />

Which will automatically get shortened by twitter.

So what I want to do then is catch the URL (url=...)on my unbit.php page, unshorten it to the full url, log the details in a table and then pass on the user from my website using the unshortened url link.

user3177012
  • 663
  • 2
  • 8
  • 19

1 Answers1

0

I hope I understand your question correctly. You can have unbit.php call the bit.ly URL and then get the location of the URL it forwards too. See this example: php get url of redirect from source url

If you don't want to use cURL, try something like this: https://stackoverflow.com/a/12566320/3079918

Community
  • 1
  • 1
magnetronnie
  • 505
  • 3
  • 16