4

有没有一种简单的方法可以从 RSS 格式的谷歌新闻提要中获得更高分辨率的图像?目前我可以访问 80*80 的图像,即缩略图,但我想有一种方法可以通过更改图像 url 来获得更高的分辨率。有没有人设法做到这一点?

我使用 PHP 脚本调用 RSS 提要,然后通过 javascript/jquery 在我的界面上显示新闻项目。

4

1 回答 1

5

Is there an easy way to get higher resolutions for images from the google news feed in its RSS format?

RSS is RSS is RSS. It provides one place to stick an image, and the feed in question is using it for the Google News logo.

The images you're asking about aren't even part of the RSS itself, but of the HTML description of each item. Each URL looks something like:

//nt0.ggpht.com/news/tbn/PKgVs2QD1QaYnM/6.jpg

Opaque as all hell right there. You'd think that PKgV... is a unique identifier for the story, but it's not repeated anywhere else in the item.

I played around with the rest of the filename. Here's what I found so far:

  • 1.jpg: 100x100
  • 2.jpg: 100x66
  • 3.jpg: 60x60
  • 4.jpg: 60x40
  • 5.jpg: empty 1x1
  • 6.jpg: 80x80
  • 7.jpg: empty 1x1
  • 8.jpg: empty 1x1
  • 9.jpg: 70x46
  • 10.jpg: 70x70
  • 11.jpg: 150x150
  • 12.jpg: 80x45
  • 13.jpg and all subsequent numbers: 80x53

So, it looks like if you manually search and replace the image URL, changing it from 6 to 11, you'll get a 150x150 image instead of an 80x80. Usually. I tested with a few other search terms and found small variations on each size depending on each image.

Be warned that this is most likely not to be true forever, and you're basically playing with an unknown, undefined application here. Google may even be upset at you for using the "wrong" images.

于 2012-12-30T21:45:32.787 回答