rhyolight
(Matt Taylor)
May 16, 2016, 2:56pm
1
Anyone know if there is a plugin for Arxiv links? Our community references a lot of scientific papers from this website. Here’s an example link:
The important data for the onebox would be the title, author, submission date, and abstract.
If there is not one yet, I’m thinking about creating one. If anyone else would use it, please .
4 Likes
Do they support opengraph or oembed? Check that first. Then you could simply whitelist the domain.
rhyolight
(Matt Taylor)
May 16, 2016, 8:16pm
3
It doesn’t seem like it. At least I can’t find any details on their website about support. It looks like onebox plugins are not that difficult to put together. At least this one seems pretty simple:
# name: Steam Store Widget Onebox
# about: Simple Steam Store display box for Discourse
# version: 0.2
# authors: fearlessfrog
# url: https://github.com/fearlessfrog/steamstorewidget-onebox
Onebox = Onebox
module Onebox
module Engine
class SteamStoreWidgetOnebox
include Engine
matches_regexp(/^(https?:\/\/)?([\da-z\.-]+)(steampowered.com\/)(.)+\/?$/)
def to_html
# Use the Steam support iframe widget over https
widget_url = @url.gsub('/app/','/widget/')
widget_url = widget_url.gsub('http:','https:')
"<iframe src='#{widget_url}' frameborder='0' width='100%' height='190'></iframe>"
This file has been truncated. show original
2 Likes
rhyolight
(Matt Taylor)
May 16, 2016, 9:46pm
5
It doesn’t look awful. The JSON looks decent:
{
"citation_title": "Encoding Data for HTM Systems",
"citation_author": "Purdy, Scott",
"citation_date": "2016/02/18",
"citation_online_date": "2016/02/18",
"citation_pdf_url": "http://arxiv.org/pdf/1602.05925",
"citation_arxiv_id": 1602.05925,
"html-title": "[1602.05925] Encoding Data for HTM Systems",
"shortcut icon": {
"href": "http://arxiv.org/favicon.ico",
"type": "image/x-icon"
},
"charset": "UTF-8"
}
Not a good icon, but better than nothing.
1 Like
rhyolight
(Matt Taylor)
May 16, 2016, 11:05pm
6
I updated my onebox whitelist to include arxiv.org
, but they still do not resolve to anything. Just the same URL I pasted.
They are cached very very heavily so be sure to use a new URL that you haven’t used in the last 48 hours.
1 Like
rhyolight
(Matt Taylor)
May 16, 2016, 11:27pm
8
No dice with a new URL. I see the little loading icon by the URL in the preview for a split second, then just the URL after the icon goes away.
The fact that the loading indicator icon comes up seems to indicate that the whitelist is working, but the onebox is not loading.
Sure @techapj can have a quick look now that we’ve done the basic due diligence.
1 Like
techAPJ
(Arpit Jalan)
May 17, 2016, 4:54am
10
Hi Matt,
I looks like [1602.05925] Encoding Data for HTM Systems does not have OpenGraph or oEmbed tags with content information. Onebox requires these meta tags to parse the data.
Yes, onebox support can be added via plugin, but since you are on Standard plan you will not be able to install custom plugin on your instance. Only Enterprise plan supports installation of custom plugins.
4 Likes
riking
(Kane York)
May 20, 2016, 11:45pm
11
techAPJ:
Yes, onebox support can be added via plugin, but since you are on Standard plan you will not be able to install custom plugin on your instance. Only Enterprise plan supports installation of custom plugins.
This means that the best course of action is to make it part of the onebox repo, as arxiv is a sufficiently general website that I think multiple Discourse websites would benefit from having it.
4 Likes
rriemann
(Robert)
May 23, 2016, 9:01am
12
Hey @rhyolight ,
have you tried already to convince Arxiv to support opengraph/oembed?
rhyolight
(Matt Taylor)
May 23, 2016, 4:43pm
13
Yes I have, but I doubt they will support it. Arxiv is a very basic website without much funding for website administration or continuing development.
rriemann
(Robert)
May 23, 2016, 4:57pm
14
Than maybe a 3rd party website instead that allows to search in arXiv as well?
Something like Google Schoolar?
rhyolight
(Matt Taylor)
May 23, 2016, 7:36pm
15
That’s a good idea. I can find arxiv papers via Google Scholar, but they do not have their own page, just search results. Each result links directly to the arxiv paper.