externally embedding OSF preprints
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.
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.
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"
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