Onebox does not work when summary opengraph tag is not present?


#1

I am not sure if I should be doing something differently.

Check out these two posts.

Here it works well.

And here it does not.


(Robert McIntosh) #2

onebox works when the site being ‘boxed’ has correctly implemented OG tags (or other recognisable content tags) so that the preview can be created

I believe that is the case here (in the second example there is not much content to be presented in the summary)

You will notice it works on some Wordpress sites and not others for the same reason

Nothing you can do about it if the site itself has not optimised itself


#3

Makes. Sense. Thanks.


(Jeff Atwood) #4

The tags that need to be present in the page are OpenGraph and/or oEmbed. Feel free to search for info about either of those.

Use Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed to test as needed


(Christoph) #5

According to http://ogp.me/ the four required tags for OpenGraph are title, type, image, and URL. What I don’t understand is why this url works (i.e. is being oneboxed), even though the only OG tag on that page is og:image (according to http://iframely.com/debug)

while this one does not work even though it works fine on facebook )in supports three out of the four required tags):


(Jeff Atwood) #6

Very popular, world famous websites have custom oneboxers. Everyone else falls back to opengraph and oembed.


(Christoph) #7

Okay, this page

now supports all four requried OpenGraph tags, title, type, image, and URL, (see here on iframely) but it is still not being oneboxed by discourse.

Could you specify what other tags discourse requires for oneboxing?


(Jeff Atwood) #8

Not true. I see no summary opengraph tag in iframely. How can you possibly summarize an URL without an actual summary??


(Christoph) #9

Pretty much all I know about OpenGraph is from http://ogp.me/ and there it does not mention the summary tag as a requirement. But I hear you say: discourse wants the summary tag, which is fine. I will let the admin of that website know (I’m just helping them in getting their pages oneboxed in discourse).

You can do a onebox using just the title and the image, no? And not that I expect discourse to do that, but facebook even manages to compensate for missing summary tags, probably by parsing the page for other hints.


(Jeff Atwood) #10

Summary is required otherwise there is no summary.


(Christoph) #11

Just to be clear: by “summary” you mean the og:description tag, right?


(Christoph) #12

With the og:description tag it now works here on meta but on my site that particular url that I have used over and over again for testing on my site still doesn’t get oneboxed (other urls on that site do).

It looks like some caching or rate limit thing to me. How can I get my instance to forget everything it knows about that url and start from scratch. Or, if nothing is being cached locally, how to I get my instance to bypass any other caches and get the page straight from the source server?


(Jeff Atwood) #13

Good question, @eviltrout?

You can add bogus querystring to the URL like

http://example.com/foo

vs

http://example.com/foo?x=1


(Robin Ward) #14

If you edit a post containing the onebox, it’s supposed to pass the refresh flag through so it refreshes. Otherwise we rely on the cache.


(Christoph) #15

In all this testing, I have not published a single post on my site, I only looked at the preview in the editor. Might this explain things, i.e. that no refresh flag was sent?


(Robin Ward) #16

Yes previewing will always use the cache to avoid constantly requesting the same thing. If you need to refresh the onebox after a code update or something, try editing and saving the post again with minor changes.


(Christoph) #17

Which cache are we talking about, though? Because since I never actually saved the post, where would the page be cached? In other words, this is not about changing an existing post but just trying (previewing) the same url repeatedly with 6-12 hours in between tries.


(Robin Ward) #18

Requests to the local onebox URL (which is called to expand links) has a cache. It is called when previewing and saving the post.


(Christoph) #19

This is not working. Edit and save does not seem to cause a refresh. It keeps using the cached version.


(Robin Ward) #20

Did you make any changes to the post when you edited it? If the content hasn’t changed we won’t save it. I often try adding a space or a word somewhere.