4

I am currently creating a php app part of which involves placing geotagged photos on a Google map, I would like to be able to place all geotagged publics photos from Flickr on this map, rather than just those from a specific user. I have managed to grab some seemingly random photos using the following link:

http://api.flickr.com/services/feeds/geo/flickr.photos.search

But I want to grab all the photos available, does anyone know how I could go about doing this?

hakre
  • 193,403
  • 52
  • 435
  • 836
cm381
  • 167
  • 1
  • 4
  • 16
  • possible duplicate of [Make a Web Crawler/ Spider](http://stackoverflow.com/questions/3209499/make-a-web-crawler-spider) – spraff Jan 24 '12 at 14:17
  • 1
    That has no relevance to my question, they are not talking about php or Flickr. – cm381 Jan 24 '12 at 14:21
  • I assumed you wanted to grab all the images and then work on them. Do you want to scrape the images from Flickr as your php is running? – spraff Jan 24 '12 at 14:25
  • 2
    Also, you should check the terms of use. You might get kicked off. – spraff Jan 24 '12 at 14:26
  • 1
    I am not trying to download the images from Flickr, I just want to place them on a Google map. I have checked the terms and this is allowed. Many other people have done similar things in their apps/websites. – cm381 Jan 24 '12 at 14:41
  • It still sounds like you are trying to write a crawler, even if you don't download the linked media. – spraff Jan 24 '12 at 14:47
  • How do you want to tell the API in which area you're looking for the photos? Maybe you can search by location / area? – hakre Jan 25 '12 at 13:09
  • @hakre I would like to get photos from all over the world so don't really want to narrow it down to a specific location. – cm381 Jan 25 '12 at 16:27
  • Can you imagine how large that list would be? – hakre Jan 25 '12 at 16:42
  • @hakre yes, it will be a huge list, we will need to narrow it down in some way but I was hoping to get a url that returns this and then further reduce it. – cm381 Jan 25 '12 at 17:35
  • @hakre I'm sure Flickr has put a limit on the amount of photos you can return at once, so if someone knows a url that would return maybe a few thousand photos that would be great. – cm381 Jan 25 '12 at 17:46
  • @cmoore89: You must be kidding. – hakre Jan 25 '12 at 20:19
  • So @cmoore89, have you figured out a way to do that? – tom Mar 05 '12 at 21:34

2 Answers2

3

Having a very brief look through the Flickr API I would suggest you might need to do something like the following:

  • request recent public photos using flickr.panda.getPhotos
  • loop through and plot your photos on the map using the lat/long values returned in the results.

I don't think you will be able to request all public photos (other than maybe your own).

An example result from flickr.panda.getPhotos looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
  <photos interval="60" lastupdate="1327418852" total="62" panda="wang wang">
    <photo title="Disneyland Transport 3" id="6745836781" secret="5890dc399e" server="7162" farm="8" owner="40910903@N04" ownername="Wicked Transport" latitude="28.38113" longitude="-81.568336" accuracy="11" />
    <photo title="Mears Motor Coaches 1" id="6745840323" secret="cc0553ecd7" server="7155" farm="8" owner="40910903@N04" ownername="Wicked Transport" latitude="28.38113" longitude="-81.568336" accuracy="11" />
    <photo title="Igreja de Santa Rita" id="5586974263" secret="68ac3fcde2" server="5263" farm="6" owner="52904565@N03" ownername="Travessia Bacana" latitude="-18.645269" longitude="-43.433761" accuracy="10" />
    <photo title="Disneyland Transport 4" id="6745837615" secret="f72ef7e744" server="7012" farm="8" owner="40910903@N04" ownername="Wicked Transport" latitude="28.38113" longitude="-81.568336" accuracy="11" />
    <!-- SNIP! -->
  </photos>
</rsp>
Chris
  • 6,568
  • 3
  • 22
  • 21
2

Check out this from the flickr API. Use 1 for public photos. You may also want to check out min_upload_date as well from the API, which allows you to display photos after the date you specify.

privacy_filter (Optional) Return photos only matching a certain privacy level. This only applies when making an authenticated call to view photos you own. Valid values are: 1 public photos 2 private photos visible to friends 3 private photos visible to family 4 private photos visible to friends & family 5 completely private photos

theDazzler
  • 1,039
  • 2
  • 11
  • 27