Use Wikipedia Onebox for other MediaWiki sites

AI-generated summary

The discussion revolves around the Wikipedia Onebox feature in Discourse and its limitations. Currently, the feature is hardcoded to only work with Wikipedia sites, but users want to expand it to support other MediaWiki-driven sites. Freso suggests listing other sites to be parsed by the onebox, while pfaffman points out that there is a domain whitelist in admin settings that can be used to add other sites. However, this does not trigger the wikipedia_onebox.rb script, which has additional features like showing specific referenced sections.

Freso notes that not all MediaWiki sites return proper “onebox” data, making it challenging to implement. codinghorror explains that the current restrictions are in place to prevent DDoS attacks and wasted HTTP requests.

Paracelsus asks if it’s possible to adapt the existing Wikipedia onebox script to work with their specific MediaWiki install, which they own and host on their website.

Currently wikipedia.(com|org) is hardcoded in wikipedia_onebox.rb, but there are plenty of other MediaWiki driven sites for which this onebox would (or should!) work just the same.

It would be neat if it could be made possible to list other sites/URLs to get parsed by this onebox.

1개의 좋아요

admin/settings search for “onebox”. There is a domain whitelist. You can add “com” (or maybe it’s .com I’ve not bothered to figure out which and just put both) if you want to whitelist everything. I’m not quite sure why this level of paranoia is necessary, so I eventually added com, edu, and so on.

1개의 좋아요

That doesn’t trigger the wikipedia_onebox.rb onebox script though, which has neat stuff like showing the specific referenced section (also, apparently not all MediaWiki sites return proper “onebox” data, e.g., http://iframely.com/debug?uri=https%3A%2F%2Fwiki.musicbrainz.org%2FDevelopment%2FSummer_of_Code )

Oh. (I should have been clued in to that by your referencing the source.)

And wow. I hadn’t realized how many of those oneboxes were hand-coded for each site. I’d been crediting those sites with making that happen.

It becomes very easy to DDoS your site by writing a post with a hundred oneboxes, etc. And most sites on the web don’t support opengraph or oembed, so it’d be a wasted HTTP request for every URL.

4개의 좋아요

Aha. Well, now I see. That’s helpful.

I suppose if I had thousands (or even hundreds) of messages per day rather than dozens, and I wasn’t having people post oneboxes of their Wordpress sites I might go ahead and be properly paranoid sooner rather than later.

Thanks

같은 주제에 대해…

… 저희는 미디어위키 설치 환경(웹사이트 소유)을 갖추고 있으며, 디스코urses 포럼에서 해당 위키 전용으로 원박스(Onebox)를 사용하고자 합니다. 기존 위키피디아 원박스 스크립트를 가져와 저희 위키에 맞게 수정하는 것이 가능한가요?