I'm knitting a series of HTML reports for public use. Not self-contained. I'm seeing the API key (googleway package) is embedded inside the HTML document, but it's my understanding that this is not very secure. Is there a solution/alternative to this? One idea I had was editing the HTML where the key is kept. Change from <script src="https://maps.googleapis.com/maps/api/js?key=xxx&libraries=visualization,geometry,places,drawing"></script>
to <script src="map_key.js">
Saving the api key file locally. But I don't want to edit every single file. Another idea is to write an R script to edit HTML?
I'll do that, open an issue. I was able to write a small script using xml2. I suppose that is the best solution for now! Here's my solution if others have trouble. I saved the js file that the API called into api.js.
Great !
Maybe you should using xml_find_first And XPATH so that it does not break in the future if position changes. XPATH is not easy at first but it is useful !