如何从 Flickr 检索所有带有地理标记的公共照片?

发布于 2024-12-28 16:42:07 字数 324 浏览 2 评论 0原文

我目前正在创建一个 php 应用程序,其中一部分涉及将地理标记照片放置在 Google 地图上,我希望能够将 Flickr 中的所有带地理标记的公共照片放置在此地图上,而不仅仅是来自特定用户的照片。我设法使用以下链接抓取了一些看似随机的照片:

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

但我想获取所有可用的照片,有谁知道我该怎么做?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

软的没边 2025-01-04 16:42:07

简单浏览一下 Flickr API,我建议您可能需要执行以下操作:

  • 使用 flickr.panda.getPhotos 请求最近的公开照片,
  • 循环遍历并使用以下命令在地图上绘制您的照片结果中返回的纬度/经度值。

我认为您无法索取所有公开照片(除了您自己的照片)。

flickr.panda.getPhotos 的示例结果如下所示:

<?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>

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>
仙女 2025-01-04 16:42:07

flickr API 查看此内容。使用 1 表示公开照片。您可能还想从 API 中查看 min_upload_date,它允许您在指定日期之后显示照片。

privacy_filter(可选)仅返回与特定内容匹配的照片
隐私级别。这仅适用于进行经过身份验证的调用时
查看您拥有的照片。有效值为:1 公开照片 2 私人照片
朋友可见的照片 3 家人可见的私人照片 4 私人的
朋友可以看到的照片家人5张完全私密的照片

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文