Created
March 7, 2018 21:47
-
-
Save bssanchez/b9ef2c19a083d1b91d13c8bbdc767d4a to your computer and use it in GitHub Desktop.
Get orginal profile image from twitter with curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $ch = curl_init(); | |
| curl_setopt_array($ch, array( | |
| CURLOPT_URL => "https://twitter.com/[CUENTA]/profile_image?size=original", | |
| CURLOPT_HEADER => false, | |
| CURLOPT_RETURNTRANSFER => 1 | |
| )); | |
| curl_exec($ch); | |
| $redirect = curl_getinfo($ch, CURLINFO_REDIRECT_URL); | |
| curl_close($ch); | |
| echo $redirect.PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment