I’m building a website (hosted on GoDaddy) that will display graphs and charts about data obtained via another website’s API. The other website updates its data only once a day, so I only need to make an API call once a day to get up-to-date info. Here’s my plan:
-
A Ruby script on my hosting server’s filesystem does the API call, and saves relevant info to .txt files on that local filesystem.
-
Another Ruby script generates a whole bunch of PHP files based on a bunch of different slices and dices of the data in those .txt files. (The PHP files are what process user requests)
-
Both of the above scripts are run as cron jobs, once per day.
To rephrase my question: Where do server-side scripts, which are agnostic toward user requests, get placed on the website’s file system, specifically if a user is never supposed to see them or even really know they exist? (Or am I mistaken in assuming a setup like /ruby/script.rb is bad practice because people could directly access that file via a web browser?)
Or is my whole approach to this fundamentally flawed? I should clarify that I’m doing this project to teach myself Ruby and learn more about web development.
Under
/srvif placed by the sysadmin, in/usr/share/<appname>if packaged up.