"Onebox Assistant",可靠地抓取那些预览!

I don’t know how to install this plugin, can you write a simple method? @merefield

Thank you!

1 个赞

Same as any other plugin, see: Install Plugins in Discourse

I’ve updated the OP to make that more obvious :slight_smile:

1 个赞

Thanks! I have installed this plugin in my meta, but I found that onebox still can’t support twitter, I mean the preview card can’t be shown after I pasted the twitter link… Youtube and other website links works!

This plugin needed a big update based on the recent refactor in core about 2 weeks ago.

Here it is, should be working now:

https://github.com/merefield/discourse-onebox-assistant/commit/682fdf028114fb4f0364d2b68434d6e067d0ebde

1 个赞

Love the plugin @merefield! Just wanted to point out that if you paste a link into the composer, the title takes a while to update - compared to without the plugin (as an example it took a youtube link 5-10 seconds vs pretty much instantly.without the plugin). Is there a way the title could be fetched in the usual way?

It naturally takes longer because you are reaching out to a third party crawler API.

That call will be faster if the API has cached the result. If it’s novel for the API it will take longer. Nothing we can do about that.

Not sure how that would work? The title also comes from a scrape of the target via the crawler API.

1 个赞

Ah ok. I thought the third party crawler could fetch the image and the rest could be done by the in built crawler.

Its only function is to fetch the target page source so it can pass that to Onebox to do its thing.

2 个赞

I’ve pushed a couple of core compatibility fixes for this, and a settings bug fix :bug: cheers! :hammer_and_wrench:

4 个赞

看起来这个插件导致所有 onebox 在 GET /onebox 路由上都返回 404。我禁用了该插件后重新构建了我的网站,onebox 又可以正常工作了。在管理面板中禁用似乎没有帮助……

2 个赞

有趣。它在 Commits · discourse/discourse (github.com) 上运行。

最近几天有重大更改?

1 个赞

可能是我的设置问题,在我重建之前,我们使用的是 Commits · discourse/discourse · GitHub

1 个赞

不,我认为你是正确的。这真的很有用,而且更新,减少了搜索 :+1:

1 个赞

我遇到了同样的问题,我也认为通过完全卸载插件可以解决它。禁用它并没有解决。

事实上,我认为这是因为我卸载了 onebox assistant。这已经是几天前的事了,我不能 100% 确定,但我的问题与你的完全相同,所以……

另外,我安装的插件截图可能错误地显示了问题发生时实际安装的插件。我确定的是,仅仅重建并没有解决问题,onebox assistant 已经被禁用了很长时间,我除了从 app.yml 中删除它之外没有做任何其他事情。我可能在重建后、再次测试之前截了这张图……

2 个赞

由于覆盖的性质和复杂性,“禁用”该设置会移除辅助功能,但不会移除覆盖本身。

该插件可能有点脆弱,对此几乎无能为力(除非可能通过 PR 更改核心结构),尽管您已经看到它在安装期间的整个时间里都可以长时间运行而无需干预,因为那些覆盖一直都在应用。

您可以通过阅读代码来了解该设置的作用。

1 个赞

这不相关,但我在重新烘焙了大量导入(160 万篇帖子)的所有帖子后,使用了该插件,其中包括包含 Youtube 视频的帖子。Youtube 最后因为嵌入过多而将我的 IP 列入了黑名单。安装并启用 Onebox Assistant 解决了这个问题,在重新烘焙后我不再需要它了。我禁用了它,但没有删除它(以防万一,你知道的)。它非常适合这项任务。

6 个赞

是的,它工作的时候很好,很高兴它有用 :+1:

我正在看,但不能保证很容易修复,我们拭目以待!

2 个赞

好的,情节更加扑朔迷离……在开发环境中,使用最新的核心版本,无需更改即可正常工作……

1 个赞

我已经更新了两个站点,开发站点,它们都正常工作。插件没有任何更改 :+1:

请确保插件已启用并且代理调用始终处于开启状态。

总之,我没有发现问题。

抄送:@Canapin

3 个赞

那么也许(或者肯定?)它与插件无关了?老实说,当我试图解决一个问题时,我经常会忘记我尝试过什么或没尝试过什么。当我注意到问题消失时,它似乎已经自行解决了。一个将永远是个谜的谜团。

无论如何,罗伯特,感谢你一如既往的出色工作。:+1:

5 个赞