如何从网站的 URL 获取网站的缩略图?

发布于 2024-12-12 05:25:34 字数 657 浏览 0 评论 0原文

我想通过输入网址来保存网站的缩略图,例如,如果我输入 http://www.google.com< /a> ,它应该生成谷歌搜索页面的缩略图。

到目前为止我一直在使用的一个这样的 API 是 http://counter2.goingup.com/thumboo/image.php。 示例网址:

http://counter2.goingup.com/thumboo/image.php?i=1f899e4e1abf9473ccae69de4f3ec1ca|||www.google.com|||80x50

但是,晚了它显示错误“找不到网址”。有人知道这个 API 究竟出了什么问题吗?

还有其他这样方便的第三方 API 可以对我有一些帮助吗?我所说的方便,是指每次在数据库中找不到该网站的任何预先存在的快照时,它不应该显示蹩脚的屏幕截图排队消息。

I want to save the thumbnails of a website by just entering their urls , e.g if I enter http://www.google.com , it should generate the thumbnail of the google search page .

One such API that I was using till now is http://counter2.goingup.com/thumboo/image.php.
A sample url for that :

http://counter2.goingup.com/thumboo/image.php?i=1f899e4e1abf9473ccae69de4f3ec1ca|||www.google.com|||80x50

But , off late it's showing the error "URL not found" . Do anybody know what exacly has gone wrong with this API ?

Is there any other such convenient third party API out there which can be of some help to me . By convenient , I mean, it should not show a lame Screenshot queued up message everytime it fails to find any pre-existent snapshot for that website in their db.

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

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

发布评论

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

评论(2

白昼 2024-12-19 05:25:34

使用 PhantomJS 创建屏幕截图。 PhantomJS 附带了一个名为 rasterize.js 的示例,它正是这样做的。示例:

phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png

文档此处。相关项目,包括网络服务此处

Use PhantomJS to create screenshots. PhantomJS comes with an example called rasterize.js, which does exactly this. Example:

phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png

Docs here. Related projects including web services here.

西瓜 2024-12-19 05:25:34

http://snapit.io 效果很好,可以为您提供 CDN 上的历史缓存。例如,此 URL 看起来像

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls

如果您想要 200x200 像素的缩略图(保持纵横比),你可以这样做

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls&max_width=200&max_height =200

还有很多类似的其他服务,但大多数都需要订阅才能进行大量使用(包括snapit.io), http://url2png.com, http://www.shrinktheweb.com, http://www.thumbalizr.com

http://snapit.io works well, and gives you historical caching on a CDN. For example this URL would look like

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls

if you wanted a thumbnail of 200x200 pixels (keeping aspect ratio) you could do

http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls&max_width=200&max_height=200

There's a lot of other services just like this out there, most require a subscription for any substantial amount of use though (including snapit.io), http://url2png.com, http://www.shrinktheweb.com, http://www.thumbalizr.com.

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