Created
April 2, 2012 19:42
-
-
Save cthos/2286656 to your computer and use it in GitHub Desktop.
Get Raw Gist from Curl
This file contains 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 | |
$test_url = 'https://gist.github.com/2286656'; | |
$bits = explode('/', $test_url); | |
$id = array_pop($bits); | |
$raw_url = 'https://raw.github.com/gist/' . $id; | |
$ch = curl_init($raw_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$output = curl_exec($ch); | |
var_dump($output); // That's the raw gist, I think for the latest iteration |
Author
cthos
commented
Apr 2, 2012
via email
And that is how you get a raw gist from the normal gist url
…On Apr 2, 2012 2:47 PM, "Derek Myers" < ***@***.***> wrote:
Interesting...
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2286656
+1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment