Include GitHub Files in the Remote Website

What is an easy way to embed a GitHub README.md file on a remote website?

I would like to have a synchronized copy of the README file on the web page, I think the GitHub pages do not allow users to do this, and I did not find my answer in the GitHub API. Any idea?

+3
source share
3 answers

This may be the solution to my problem: Using the API GitHub and PHP to get information about the repository and there is a working demonstration.

+1
source

, , , , example.com/project/README.md -, php-. , php script . php-, - :

<?php
$url = "https://raw.github.com/USER/PROJECT/README.md";
$readme = file_get_contents($url);

print $readme;
?>

script,

<?php
$url = "https://raw.github.com/USER/PROJECT/README.md";
$readme = file_get_contents($url);

$file = fopen('README.md','w');
fputs("$file","$readme");
fclose($file);
?>
+1

Take a look at http://developer.github.com/v3/git/blobs/

You can extract and create drops.

+1
source

All Articles