5

Is there an easy way to get higher resolutions for images from the google news feed in its RSS format? Currently I have access to images which are 80*80, i.e. thumbnails but I would imagine that there is a way to get higher resolutions via altering the image urls. Has anyone managed to do this before?

I am calling the RSS feed using a PHP script and then displaying the news items on my interface via javascript/jquery.

Charles
  • 50,943
  • 13
  • 104
  • 142
Bob-ob
  • 1,560
  • 4
  • 18
  • 34
  • The answer depends entirely on the RSS feed itself. How about an example? – Charles Dec 30 '12 at 18:46
  • I am calling the feed using PHP like so: $url = "https://news.google.com/news/feeds?hl=us&q=$q&num=$o"; where $q is the term, e.g. Football and $o is the number of results to be returned, by default I set this to be 10. – Bob-ob Dec 30 '12 at 20:30
  • An example of potential output would be https://news.google.com/news/feeds?q=football&num=10&output=rss – Bob-ob Dec 30 '12 at 20:32

1 Answers1

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
  • Thank you for your time on this Charles. It was a little bit of a pain to get usable data from the rss feed to begin with, particularly when parsing the images, descriptions etc. I have simply included a broken image link in the img tag for the moment so that the original image source will be presented as a worse case scenario. Thanks again, let's hope this isn't changed anytime soon :D – Bob-ob Jan 02 '13 at 14:53
  • 1
    Is this still a viable solution? I now find the images stored under a "gstatic" URL rather than ggpht, and does not contain any /#.jpg. but is simply a big long like of chars and numbers. Apologies for necro. – Aphire Jul 03 '15 at 13:21
  • Everything documented here was discovered by trial and error. There's no documented method to get larger thumbnails. If they changed how it works in a way that eliminates the useful filenames, then there's probably no alternative. – Charles Jul 06 '15 at 18:26
  • Not exactly my issue but it turned me on to the idea that I could modify my URLs slightly to get the same images I wanted in a higher quality than the ones given in the img tag of my RSS feed. – Chucky Jun 08 '17 at 12:39