I have a Wordpress install with number of URLs of TXT files, stored in custom files in posts. I'd like to retrieve the text from those files, save it to Wordpress and then display it when that post is called.
I've tried something like:
<?php
$homepage = file_get_contents('https://www.theFile.com/file.txt');
echo $homepage;
?>
But the remote server doesn't allow me to call it that often. Would there be a way to
check if TXT is in place
if so, render text from local file
if not, fopen remote TXT file
save txt file to local
render txt from local file
Or if there a more Wordpress-y way of doing this?