获取&自托管 XML Feed
我遇到过这样一种情况,一家公司向我提供了一个带有以下限制的 xml 文件:
- 用户名/密码受保护
- 存储在他们的 ftp 上
- 我不允许从我的应用程序中引用该文件
所以我希望能想出一些方法来获取每小时更新一次 xml 文件(因为他们的文件每小时更新一次),并将其托管在我自己的域上。
有人对创建这样的东西有任何建议吗?或者是否有任何现有脚本可以为我做这件事?
非常感谢, 格伦
I have a situation whereby a company is providing me an xml file with the following restrictions:
- Username/Password protected
- Stored on their ftp
- I'm not allowed to reference the file from my application
So I was hoping to come up with something to fetch the xml file every hour (as their file is updated hourly), and host it on my own domain.
Would anyone have any suggestions about creating something like this, or is there any existing scripts that might do it for me?
Many thanks,
Glen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用简单的 PHP 来缓存远程文件并提供本地副本。
基于这个 PHP Remote File Cache 示例,你可以这样做(未经测试):
You could use a simple bit of PHP to cache the remote file and serve up the local copy.
Based on this PHP Remote File Cache example you could do something like this (untested):