Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

externally embedding OSF preprints #9302

Open
eplebel opened this issue Feb 25, 2020 · 3 comments
Open

externally embedding OSF preprints #9302

eplebel opened this issue Feb 25, 2020 · 3 comments

Comments

@eplebel
Copy link

eplebel commented Feb 25, 2020

Tweet from Feb 22 (https://twitter.com/curatescience/status/1231239654332129283)
@osframework is there a way to embed OSF preprints (e.g., https://psyarxiv.com/uwmr8) on external websites/content providers?

I can't seem to see a way/find any info on this.
Context: Embedding is crucial for increasing/maximizing accessibility and impact of scholarly output.

it appears one may be able to externally embed an entire OSF preprint page (e.g., https://psyarxiv.com/uwmr8), but this is of course not an elegant or desirable solution.

please let me know, thank you.

@Johnetordoff
Copy link
Contributor

You can embed the PDF for a preprint as an iframe with the url https://mfr.osf.io/render?url=https://osf.io/download/c3f5h/?direct%26mode=render (for your example preprint.) Sorry this isn't more visible.

@eplebel
Copy link
Author

eplebel commented Dec 3, 2021

ah ok that's good to know,
but i tested a different preprint https://osf.io/r5c28/

https://mfr.osf.io/render?url=https://osf.io/download/r5c28/?direct%26mode=render

and got the following error: "INTERNAL SERVER ERROR"

and this one ( https://psyarxiv.com/fcxge/ ) also gives same error, so it's not related to the different URL prefix "psyarxiv"

@Johnetordoff
Copy link
Contributor

Johnetordoff commented Dec 3, 2021

Sorry about this bug, we're looking at fixing it now. However there's still a workable alternate way of embedding the preprint:

https://mfr.osf.io/render?url=https://files.osf.io/v1/resources/r5c28/providers/osfstorage/595d99f59ad5a1022c00863d%3Fmode%3Drender%26direct%3D

The formula for creating the link being: https://mfr.osf.io/render?url={the file service download url with specific file id, not guid}%3Fmode%3Drender%26direct%3D the ?mode=render&direct= query parameters must be url encoded but not other characters. Unfortunately the preprint guid (like fcxge) is not enough identify the file id, but if visit https://api.osf.io/v2/preprints/fcxge/ you can see the primary_file relationship with the file id listed.

So sorry about that, we are working on making this more intuitive in the future, I just thought you'd might like to know there is a workaround, here's the embedded fcxge for example: https://mfr.osf.io/render?url=https://files.osf.io/v1/resources/fcxge/providers/osfstorage/584edc98594d9001fb560cca%3Fmode%3Drender%26direct%3D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants