Note: Services for club and division information have been deprecated. If you want these services please email the webmaster.
These pages show how to include data such as league tables and fixtures from the South Lacrosse site within your own web pages, or use it for any other kind of processing.
If you have any trouble using these services please email Dave Slaughter at email@example.com. And thanks to Dan Scott for suggesting the idea.
If you use these services please credit where you got the data from with a link back to the South Lacrosse site, for example:
Data provided by southlacrosse.org.uk
The HTML markup is as follows:
<p><small>Data provided by <a href="http://www.southlacrosse.org.uk/">southlacrosse.org.uk</a></small></p>
Data from the South Lacrosse site is made available via REST services. If you don't know what REST is, don't worry - you don't need to be familiar with it to use these services. REST is an architectural style, not a standard, and is based on standard Web technologies. This means it should be relatively simple to use, even for novice web programmers. If you want to read up on it you might want to see the REST page at Wikipedia.
How it Works
We publish resources at specified URIs, and currently data is available in both XML and HTML formats. The default format is XML, which is returned if the extension is omitted or xml, and gives the maximum flexibility for processing on the client. HTML is returned if the extension is html, and is the the easiest format to include in another web page.
Please note: for historic reasons many resources have 'mens' as part of the URI. This is because this site originally contained data for both men's and women's leagues.
Clients (which can be other servers, web browsers, or any other computer program) can then access that resource using a simple web request, and process it in any way they wish, which in most cases will be to include the formatted data within another web page.
For a full list of resources available see the menu to the left.
HTML or XML
If you are just going to include our data in your own web page then the simplest way is to use the HTML format, and include the resource directly in your page. In order to see how the HTML is formatted you can simply enter the resource URI into a web browser to view the page output, and "view source" to see the exact HTML. You can then style the output using CSS (if required, surround the included HTML with a <div> tag with an id or class to reference it directly).
If you want to provide your own HTML formatting, or for more complicated processing, then using the XML format will be best.
Server Side Includes (SSI)
SSI is the recommended way to include our data in your own web pages. A typical interaction is detailed below:
- The user requests a page from your site
- Your server requests the league table data from the South Lacrosse server
- The South Lacrosse server returns the data in the requested format
- Your server includes the league table within your page, and returns this amalgamated page to the user
In order to speed up access to your web page, the data is usually cached on your own server, and only retrieved if the local copy is over a predefined age - say 2 hours. This means most times only actions 1. and 4. occur. Additionally it makes you a good neighbour, by cutting down on the processing and bandwidth used by the South Lacrosse site.
For sample code of how to do this see the examples page.
Client Side Includes (CSI)
If at all possible, it is recommended to use Server Side Includes, the main reasons being:
However, if you have no other way of including data from our site, then CSI can come to the rescue. A typical interaction is detailed below:
- The user requests a page from your site
- Your server returns the page to the browser (minus the league table)
- The South Lacrosse server returns the league tables, which are then inserted into the web page
In your page <body> create a <div> tag as follows in the location you want the data included:
The id must be unique within your page, and may be any value, but it must match up to the call to clientSideInclude which we are just about to add. If you are going to include more than one resource then add a separate <div> tag for each resource (making sure you have a different id for each one).
To load the South Lacrosse data into the div you must call clientSideInclude to fetch the data, passing the id of the div you want the data to be loaded into, and the URI of the resource. Usually the best place to put this is within the <body> onload event, as follows:
<body onload="clientSideInclude('sl', 'http://www.southlacrosse.org.uk/rest/tables/mens/Prem.html');">
If you are loading more than one resource then you will need to call clientSideInclude multiple times.