如何从其他网站获取元数据并在我的 ruby​​ on rails 中显示? [英] How do I grab meta data from other websites and display on mine in ruby on rails?

查看:35
本文介绍了如何从其他网站获取元数据并在我的 ruby​​ on rails 中显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 FB 或 Google + 时,我可以将任何网站的链接粘贴到状态更新框中,它会立即加载有关该网站的信息,并提供浏览缩略图的选项.

When using FB or Google + I can paste a link of any website into the status update box and it will instant load information about that website with the option of flicking through thumbnail images.

我怎样才能在 ruby​​ on rails 中实现这一点?我所有的搜索似乎都提出了有关如何执行此操作的 php 方法.

How can I go about achieving this in ruby on rails? All my searches seem to bring up php methods on how to do this.

为了获取视频数据信息,我使用了 Ruby Open Graph Protocol gem.有什么可以像 FB 和 G+ 那样抓取数据的东西吗?如果没有,是否有在 rails/ruby 中完成的标准方式,如果有的话..这是如何完成的?

For grabbing video data info I use the Ruby Open Graph Protocol gem. Is there any thing for grabbing data the way FB and G+ do? If not is there a standard way this is done in rails/ruby, if so.. how is this done?

亲切的问候

推荐答案

我认为您正在寻找类似 oembed 的东西.我为此找到了一个宝石,所以我建议你看看它:https://github.com/judofyr/ruby-oembedhttps://github.com/embedly/embedly-ruby

I think you're looking for something like oembed. I've found a gems for that, so I propose you to take look at it: https://github.com/judofyr/ruby-oembed or https://github.com/embedly/embedly-ruby

这篇关于如何从其他网站获取元数据并在我的 ruby​​ on rails 中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆