Created
August 27, 2015 17:17
-
-
Save jennschiffer/2160d9b072aaf74d8266 to your computer and use it in GitHub Desktop.
get gists w/ curl, used in gistless
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 | |
/* | |
* uses curl to get the content of a gist | |
* | |
* @param string $gistUrl | |
* @return string | |
*/ | |
function getGist($gistUrl) { | |
$curl = curl_init(); | |
curl_setopt($curl,CURLOPT_USERAGENT,'jennschiffer'); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($curl, CURLOPT_URL, $gistUrl); | |
$result = curl_exec($curl); | |
curl_close($curl); | |
return $result; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment