Oneboxing xkcd?


(Thiago Arrais) #1

Would there be interest in oneboxing xkcd? I don’t know if XKCD supports oEmbed or whatever, but I’m willing to try a PR if there is interest.


(Rafael dos Santos Silva) #2

XKCD supports OpenGraph tags already. Just whitelist it.


(Thiago Arrais) #3

Simply adding the domain to the whitelist didn’t work. Maybe I’m doing something wrong here.

I’ve opened PR #328 on Github with what I have so far. I’ll take a better look at this later. Should I interact with the team here or in the github PR?


#4

Googling “xkcd oembed” returns a ton of results, most of which appear to be third party oembed providers. You might start by researching how those are put together, but I would guess they’re using the xkcd api.

Looking at the source of xkcd, I don’t see any OpenGraph tags though.

I also don’t understand why you’ve already opened a pull request, especially if you know it doesn’t work. Maybe I’m just misunderstanding how pull requests are meant to be used though.


(Thiago Arrais) #6

I’ll take a look at those thirdy party providers, @KevinWorman. Thanks.

I didn’t see any OpenGraph tags either. But I’m a both a onebox newbie and an opengraph newbie. Maybe I’m looking at the worng place.

At this point, I’ve opened the PR as a placeholder for the discussion only. If the team prefers, I can close and re-open it only when fully ready.


#7

I don’t think that @Falco meant you should change the whitelist for everybody. I think he meant you should go to your admin console, then Settings, then Onebox, then add xkcd to your onebox domains whitelist.

But given that I don’t see any OpenGraph tags on xkcd, I’m not sure how this will help. I might be missing something though.


(Thiago Arrais) #8

I’ve put together a first version and updated the Pull Request. I’m still having trouble with the specs, but I’ll take a look at that next.


(Rafael dos Santos Silva) #9

Nice. Sorry about earlier when I said xkcd had og tags. I used Facebook Debug to test, and they create the og tags from content when needed.


(Thiago Arrais) #10

I’m done with #328. Let me know if I need to post the PR somewhere else or if you need anything else.


#11

This feels like it would be more at home in a plugin, doesn’t it? If I don’t care about oneboxing xkcd, why would I want to potentially break my Discourse because of it? What if xkcd goes down? Or changes how its API is designed?

It’s cool that you did this, but I’m just not sure it belongs in core Discourse so a pull request feels a little premature. But again, maybe I’m completely wrong!


(Rafael dos Santos Silva) #12

Actually Onebox is an independent library.

I, for one, think that xkcd is a big enough website to justify a custom one boxer, like we do with another big sites.


(Jeff Atwood) #13

This works now and has for a while thanks to @zogstrip :fr:


(Jeff Atwood) #14