实现可搜索、可浏览的图片库的最快方法 - flickr 集成?
我有一个朋友需要一个网页。 他从事室内建筑工作,并希望拥有一个展示他作品的画廊。 我可能会选择一个 php 主机,并且正在考虑为他实现图像库的最佳方法。 我想出了:
- 使用 flickr 来托管图像。 它们可以被标记、添加到集合中,我可以使用标签和集合信息来显示图库的“类别”以及浏览。 Flickr 还具有多重上传工具,这样上传 20 张照片就不再是一件麻烦事了。
- 如何最好地获取 api? 有没有一个好的 PHP 库用于 flickr 集成? 我应该自己滚动吗?
- API 密钥 - 这被视为商业项目吗? 该网页是为他的生意服务的,他将付钱给我来创建该网站...
- flickr 是适合这项工作的错误工具吗? 在我看来,这似乎是一个非常好的解决方案,但是我缺少什么吗? 我根本没用过他们的API。
感谢您的任何意见!
I have a friend who is need of a web page. He does interior construction, and would like to have a gallery of his work. I'll probably go for a php host, and was thinking about the best way to implement the image gallery for him. I came up with:
- Use flickr to host the images. They can be tagged, added to sets, and I can use both the tag and set information to display "categories" for the gallery, as well as browsing. Flickr also has multi-upload tools so that a 20 photo job won't be a PITA to upload.
- How to best get at the api? Is there a good PHP library for flickr integration? Should I roll my own?
- API key - is this considered a commercial project? The web page is for his business, and he will be paying me to create the site...
- Is flickr the wrong tool for the job? It seems like a pretty good solution in my head, but is there something I'm missing? I haven't used their APIs at all.
Thanks for any input!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这听起来像是一种困难的做事方式 - 你考虑过画廊(这个名字没有创意! )。
除非您真的想节省带宽,否则我认为安装一些预建的图库会获得更好的结果。
It sounds like a difficult way to do things - have you considered Gallery (No points on creativity for the name!).
Unless you're really wanting to save on bandwidth, I think you'd get much better results from installing some pre-built gallery.
解决此类问题的完美解决方案是 Picasa(当然来自 Google)
您将获得:
还需要其他吗?
Chris 致其他可能正在寻找答案的人的注意事项:可以在此处<找到该 API /a>.
The perfect solution for this kind of thing is Picasa (from Google ofcourse)
You get:
Need anyting else?
Note from Chris to others that may be looking for an answer: The API can be found here.
我最近为客户实现了一个基于 Flickr 的照片库。 由于多种原因,Flickr 非常适合他们。 Gallery 是一个令人印象深刻的开源项目,但其功能集(以及管理的复杂性)对于该客户的需求来说太过分了。
查看 Flickr API,尤其是关于 构建 URL,构建网页时需要它。 不必费心为 API 编写 PHP 包装器。 phpFlickr 已经做到了,而且这是一个明智的实现。
这是我编写的一个辅助函数,它使需要访问 Flicker 的各个页面变得更加容易:
}
这里的技巧是,您需要输入的所有内容都存储在代码的中心位置。 缓存是关键,因此请使用它。 而且,如果您在每个请求的多个位置都需要一个 phpFlickr 对象,则只需构造一次,这可以节省初始化时间。
I recently implemented a Flickr-based photo gallery for a client. Flickr was perfect for them for a lot of reasons. Gallery is an impressive open-source project, but its feature set (and complexity of administration) was overkill for what this client needed.
Check out the Flickr API, especially the section on building URLs, which will be necessary when building your web pages. Don't bother coding a PHP wrapper for the API's. phpFlickr has already done it, and it's a smart implementation.
Here's a helper function I wrote that made life a lot easier for the various pages that need to access Flicker:
}
The trick here is that all the crud you need to enter is stored in a central place in your code. Caching is key, so use it. And, if you need a phpFlickr object in multiple places for each request, you're only ctor'ing it once, which saves on init time.
阅读 SchizoDuckie 的帖子后,我查看了 php 的 picasa api,发现开始有点令人畏惧,但是我发现了这个 示例代码 对于一些基本集成的入门来说绝对出色。
其他语言的示例似乎也可用 - 无法保证其效果有用,但怀疑它们也会很好。
Having Read SchizoDuckie's post, I had a look at the picasa api for php, and found it a bit daunting to start with, however I found this sample code absolutely brilliant for getting started with some basic integration.
Samples for other languages also seem to be available - can't vouch for their usefullness, but suspect they will be good too.
这些可能会有帮助。 它们是 mootools 脚本,无需任何服务器端编码即可运行。 两者都与 Flickr 集成。
These might be of help. They are mootools scripts and run without any server-side coding necessary. Both integrate with Flickr.
如果您对 Ruby on Rails 有兴趣,此处有一个截屏视频,展示了如何创建站点与您在 RoR 中描述的类似。
If you have any interest in Ruby on Rails, there is a screencast here that shows how to create a site similar to what you are describing in RoR.