Last active
June 23, 2022 10:12
-
-
Save rdlagency/dcabc504316f08506350cb31cce0c3c3 to your computer and use it in GitHub Desktop.
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 | |
// This was a quick proof of concept from 2009, use the script freely - https://www.realisingdesigns.com/web-design-articles/using-google-docs-quick-easy-cms/ | |
// Specify document | |
$gd_doc = "dd9zpc9r_4jh8qv76j"; | |
$gd_doc_type = "doc"; | |
$gd_array = array(); | |
$gd_array["doc"]["url"] = "http://docs.google.com/View?id=".$gd_doc; | |
$gd_array["doc"]["start"] = '<div id="doc-contents">'; | |
$gd_array["doc"]["end"] = '<div id="google-view-footer">'; | |
$working_doc = file_get_contents($gd_array[$gd_doc_type]["url"]); | |
$gd_start = strpos($working_doc,$gd_array[$gd_doc_type]["start"]); | |
$gd_end = strpos($working_doc,$gd_array[$gd_doc_type]["end"]); | |
$gd_content = substr($working_doc, $gd_start, ($gd_end-$gd_start) ); | |
// Output | |
echo $gd_content; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment