Skip to content

Add support for twitter cards (full image viewer only) (rebased onto develop)#5797

Merged
joshmoore merged 9 commits intoome:developfrom
manics:rebased/develop/rebased/metadata54/rebased/metadata53/rebased/metadata52/twittercards
Sep 7, 2018
Merged

Add support for twitter cards (full image viewer only) (rebased onto develop)#5797
joshmoore merged 9 commits intoome:developfrom
manics:rebased/develop/rebased/metadata54/rebased/metadata53/rebased/metadata52/twittercards

Conversation

@manics
Copy link
Copy Markdown
Member

@manics manics commented Jun 28, 2018

This is the same as gh-5795 but rebased onto develop.


This is the same as gh-5216 gh-4613 gh-4260 but rebased onto metadata54.


Includes gh-5245 rebased onto metadata54.


I've had this lurking around since January 2014. Given that we now have a public resource and Twitter no longer require manual approvals I thought it's time to resurrect it. See https://dev.twitter.com/cards/types/summary-large-image

The title and description fields are mandatory, I'm assuming there will always be a non-empty image name, description is set to the owner's name if empty.

At risk of stating the obvious this can only be tested with a public image on an external server. Open an image in the full image viewer, copy the url into a tweet.


Note: Since this was merged into metadata in 2015 there's been a big push towards decoupled web-apps, in particular iviewer. This potentially means this PR is the start of a new omero.web config API which web apps would be expected to use if they want to provide twitter and opengraph/facebook metadata.


Testing instructions

Setup OMERO.web with a public user, and add the following configuration (the name of the server "omero" must match the key in omero.web.sharing.*, multiple sets of server configs are supported):

omero.web.server_list=[["OMERO-HOST.EXAMPLE.ORG", 4064, "omero"]]
omero.web.sharing.opengraph={"omero":"Open Microscopy"}
omero.web.sharing.twitter={"omero":"@openmicroscopy"}

Open the full image viewer (webclient/img_detail/) for an image, and view-source. You should see the following meta tags:

    <meta name="og:title" content="image.fake">
    <meta name="og:type" content="website">
    <meta name="og:site_name" content="Open Microscopy">
    <meta name="og:description" content="root">
    <meta name="og:url" content="httpX://ABSOLUTE-HTTP-URL/webgateway/img_detail/1/">
    <meta name="og:image" content="httpX://ABSOLUTE-HTTP-URL/webgateway/render_thumbnail/1/512/">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@openmicroscopy">
    <meta name="twitter:title" content="image.fake">
    <meta name="twitter:description" content="root">
    <meta name="twitter:creator" content="@openmicroscopy">
    <meta name="twitter:image" content="httpX://ABSOLUTE-HTTP-URL/webgateway/render_thumbnail/1/280/">

These tags are automatically parsed by applications such as slack or twitter to generate a preview, but the URL must be publicly accessible to test this. You can use something like the free version of ngrok if you want to test this locally e.g. ngrok http 4080.

An example docker-compose file is in https://gitlab.com/openmicroscopy/incubator/docker-dev-compose/tree/0677a98ebf75a121c417e2b45478daaefa1d2e27/omero-server-public

@manics
Copy link
Copy Markdown
Member Author

manics commented Jun 28, 2018

--rebased-from #5795

@manics manics changed the title Add support for twitter cards (full image viewer only) (rebased onto metadata52) (rebased onto metadata53) (rebased onto metadata54) (rebased onto develop) Add support for twitter cards (full image viewer only) (rebased onto develop) Jun 28, 2018
@joshmoore
Copy link
Copy Markdown
Member

@manics : do you want to try to get this into 5.4.8? If so, suggestions on how/where to configure it for testing?

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 21, 2018

I figured I should at least test it myself before getting someone else to.

@joshmoore
Copy link
Copy Markdown
Member

An example docker-compose file

    - CONFIG_omero_web_public_user=root

???

@joshmoore
Copy link
Copy Markdown
Member

👍 other than deciding on the long-term testing strategy as well as follow-ups (like adding to iviewer, etc)

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 23, 2018

- CONFIG_omero_web_public_user=root

It's the easiest way to demo a public server!

@joshmoore
Copy link
Copy Markdown
Member

It's the easiest way to demo a public server!

Sure, but don't underestimate the confusion it might cause.

@kennethgillen
Copy link
Copy Markdown
Member

If anyone's trying to understand the example, I'd second Josh's concern re: the confusion. Is it much more effort to create a "public_user_omero_account" for the sake of clarity?

@manics
Copy link
Copy Markdown
Member Author

manics commented Aug 23, 2018

Can you review ome/omero-server-docker#2 then?

@joshmoore
Copy link
Copy Markdown
Member

Sorry, this got lost between other excluded PRs and so didn't make it into rc1. Will merge with other changes for GA.

@joshmoore joshmoore added this to the 5.4.8 milestone Sep 4, 2018
@joshmoore joshmoore self-assigned this Sep 4, 2018
@joshmoore joshmoore merged commit 49bd956 into ome:develop Sep 7, 2018
@manics manics deleted the rebased/develop/rebased/metadata54/rebased/metadata53/rebased/metadata52/twittercards branch September 17, 2018 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants