Suppose I have a HTML file as --
https://raw.github.com/USER/PROJECT/master/file.html
How do I make it available in my website. One method will be using the rawgithub service and then using something like iframe
but I want the HTML to be inherited in my website so that Google shows it in the searches.
php's include function looks like doing the trick but I don't get it to work. I simply useinclude "<file_full_URL>";
$url = "http://www.example.com"; //write your raw.github.com URL
$gethtml = file_get_contents($url);
echo $gethtml; //output the content in the page
In PHP you can use the file_get_contents()
function to grab files over the internet.
$html = file_get_contents('https://raw.github.com/USER/PROJECT/master/file.html');
echo $html;
Your pages will be slower if you do this, though. Setting up a cronjob that downloads the file to your server periodically, and then serving it from your server, is a much better idea.
if you want to show it as code you can use this jquery plugin for that