Difference between revisions of "Widget:SpaceAPI"

From Hackerspace ACKspace
Jump to: navigation, search
(created first draft XMLHttpRequest spacestate)
(widget developing is impossibru)
Line 29: Line 29:
 
{
 
{
 
     "use strict";
 
     "use strict";
 
+
/*
 
     if ( typeof SpaceState === "undefined" )
 
     if ( typeof SpaceState === "undefined" )
 
     {
 
     {
Line 144: Line 144:
 
     }
 
     }
  
/*
+
    var state = new SpaceState( <!--{$width|escape:html|default:auto}-->, <!--{$height|escape:html|default:auto}-->, <!--{$url|validate:url}-->, <!--{$interval|validate:int|default:0}--> );
        "w"          : "<!--{$width|escape:html|default:auto}-->",
+
    state.start();
        "h"          : "<!--{$height|escape:html|default:auto}-->",
 
        "interval"    : 1000 * 0 <!--{$interval|validate:int|default:0}-->,
 
        "src"        : "<!--{$url|validate:url}-->",
 
 
*/
 
*/
 
    var state = new SpaceState( 260, 20, "http://ackspace.nl/spaceAPI/", 5000 );
 
    state.start();
 
 
</script>
 
</script>
 
</includeonly>
 
</includeonly>

Revision as of 11:44, 8 August 2015

This widget allows you to display the Space API data (provided as JSON)

Created by Xopr

Using this widget

To insert this widget, use the following code:

{{#widget:SpaceAPI
|url=https://ackspace.nl/spaceAPI
|width=260
|height=20
|interval=20
}}

This will give the following result:

Note that url is mandatory, the rest is optional (leave out interval to make the data static)


Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:SpaceAPI article.