Oneboxing OEIS entries

In math.SE as well as in codegolf.SE we quite often use OEIS (Online Encyclopedia of Integer Sequences), which the standard reference for sequences in combinatorics and number theory.

I think - and apparently I am not the only one - this would be an excellent addition of sites that do get oneboxed.

All the sequences available in OEIS are enumerated and have a consistent formatting, which would make it easy from a technical standpoint. As an example: http://oeis.org/A000001 the "first" sequence, which is the the number of groups (a certain algebraic structure) of the given order.

I picture the onebox to contain the number and the description, as well as the first three lines (there are usually at most three lines displayed there, if more are know they can be found under the list link) including the links that follow, basically just the header as you can see it here (screenshot):

• Yup. There's a reason why the chat message has 16 stars (and this post has 8 upvotes) and counting..
– user311725
Commented May 31, 2016 at 19:43

I have previously made a userscript that lets you make custom oneboxes for specific sites at Stack Apps: Make your own custom oneboxes for Chat!.

I've made a 'plugin' for it to onebox OEIS entries.

To use it, simply install the userscript and then paste this 'plugin' (just above the `//---------You don't need to modify the below!----------------//`):

``````customSites['oeis.org'] = function(link, \$obj) {
if(id) {
\$.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22" + encodeURIComponent('http://oeis.org/' + id) + "%22&callback=", function(d) {
var \$document = \$(d);
var \$table = \$document.find('form').parent().next();
var number = \$table.find('table:eq(1) td:eq(0)').text().trim();
var desc = \$table.find('table:eq(1) td:eq(2)').text().trim();
var sequence = \$table.find('table:eq(2)').text().trim().replace(/ *\([^)]*\)/, ''); //http://stackoverflow.com/a/4292483/3541881
var template = "<div class='oeis-container'>\