.css文件中的随机背景图像网址

时间:2023-01-16 20:23:02

I ran across this this CSS file on a videogame website. Check out the URL and wait about five minutes and refresh and the background image URL will be changed. This all happens inside the css file.

我在视频游戏网站上遇到了这个CSS文件。检查URL并等待大约五分钟并刷新,然后更改背景图像URL。这一切都发生在css文件中。

Any ideas how this is done? I've tried an extensive Google and couldn't find a solution.

有任何想法如何做到这一点?我尝试过广泛的Google,但找不到解决方案。

Link to CSS file on Rockstar.com

链接到Rockstar.com上的CSS文件

1 个解决方案

#1


0  

Use curl to retrieve it, -v option to see the headers.

使用curl检索它,使用-v选项查看标题。

curl -v http://www.rockstargames.com/downloads/randomBackground/index.css

It has a very short shelf life, does not cache for very long.

它的保质期非常短,不会长时间缓存。

The server rewrites this file, or generates it dynamically, with a different image target. When you refresh, you get the rewritten index.css.

服务器使用不同的图像目标重写此文件或动态生成它。刷新时,您将获得重写的index.css。

To elaborate, in response to the comment …

详细说明,回应评论......

The randomBackground/index.css file is just a file on the file system of the server, just like a file in a directory on your computer. The http:// … address identifies the file to the server, which sends it to you.

randomBackground / index.css文件只是服务器文件系统上的一个文件,就像计算机上目录中的文件一样。 http:// ...地址标识服务器的文件,服务器将文件发送给您。

Now, some process on the server-- a program --can have a list of background images, or look at a directory full of background images, and choose one at random or work sequentially through them. It picks an image, then rewrites the randomBackground/index.css file using the new image name. It completely replaces the old file content with new file content.

现在,服务器上的某个进程 - 一个程序 - 可以有一个背景图像列表,或者查看一个充满背景图像的目录,然后随机选择一个或按顺序工作。它选择一个图像,然后使用新的图像名称重写randomBackground / index.css文件。它完全用新文件内容替换旧文件内容。

Each time you retrieve the file you can potentially get a completely new version with new content.

每次检索文件时,您都可能获得包含新内容的全新版本。

It is also possible for the web server to map that address to a process, not a file, a program that sends the content with the random background image name. That is how I would do it; however, usually, if that is the case, the address would not look like a file name.

Web服务器还可以将该地址映射到进程,而不是文件,即使用随机背景图像名称发送内容的程序。我就是这样做的;但是,通常情况下,如果是这种情况,则地址看起来不像文件名。

#1


0  

Use curl to retrieve it, -v option to see the headers.

使用curl检索它,使用-v选项查看标题。

curl -v http://www.rockstargames.com/downloads/randomBackground/index.css

It has a very short shelf life, does not cache for very long.

它的保质期非常短,不会长时间缓存。

The server rewrites this file, or generates it dynamically, with a different image target. When you refresh, you get the rewritten index.css.

服务器使用不同的图像目标重写此文件或动态生成它。刷新时,您将获得重写的index.css。

To elaborate, in response to the comment …

详细说明,回应评论......

The randomBackground/index.css file is just a file on the file system of the server, just like a file in a directory on your computer. The http:// … address identifies the file to the server, which sends it to you.

randomBackground / index.css文件只是服务器文件系统上的一个文件,就像计算机上目录中的文件一样。 http:// ...地址标识服务器的文件,服务器将文件发送给您。

Now, some process on the server-- a program --can have a list of background images, or look at a directory full of background images, and choose one at random or work sequentially through them. It picks an image, then rewrites the randomBackground/index.css file using the new image name. It completely replaces the old file content with new file content.

现在,服务器上的某个进程 - 一个程序 - 可以有一个背景图像列表,或者查看一个充满背景图像的目录,然后随机选择一个或按顺序工作。它选择一个图像,然后使用新的图像名称重写randomBackground / index.css文件。它完全用新文件内容替换旧文件内容。

Each time you retrieve the file you can potentially get a completely new version with new content.

每次检索文件时,您都可能获得包含新内容的全新版本。

It is also possible for the web server to map that address to a process, not a file, a program that sends the content with the random background image name. That is how I would do it; however, usually, if that is the case, the address would not look like a file name.

Web服务器还可以将该地址映射到进程,而不是文件,即使用随机背景图像名称发送内容的程序。我就是这样做的;但是,通常情况下,如果是这种情况,则地址看起来不像文件名。