Difference between revisions of "Template:DJISource"

From Geohashing
imported>NuclearDog
imported>Tjtrumpet2323
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
== {{{hostname}}} ==
+
<table class="infobox" cellspacing="5" style="width: 25em; text-align: left; font-size: 88%; line-height: 1.5em; border: 1px solid #aaa; background-color: #f9f9f9; color: black; margin: 0.5em 0 0.5em 1em; padding: 0.2em; float: right; clear: right;">
 
+
<tr><td colspan="2">'''{{{hostname}}}'''</td></tr>
This source provides values at:
+
<tr><td width="50%">'''Date Range:'''</td><td width="50%">{{{startDate}}} - {{ #if: {{{endDate|}}} | {{{endDate}}} | present}}</td></tr>
 +
<tr><td>'''Update Source:'''</td><td>{{{updateSource}}}</td></tr>
 +
<tr><td>'''Update Frequency:'''</td><td>{{{updateFrequency}}}</td></tr>
 +
<tr><td>'''Server Location:'''</td><td>{{{serverLocation}}}</td></tr>
 +
<tr><td>'''Contact:'''</td><td>{{ #if: {{{contactAccount|}}} | [[User:{{{contactAccount}}}|{{{contactAccount}}}]] | {{ #if: {{{contactEmail|}}} | [mailto:{{{contactEmail}}} {{{contactEmail}}}] | Unknown }} }}</td></tr>
 +
</table>
  
 +
The source can be accessed at:
 
  {{{url}}}
 
  {{{url}}}
 
+
{{ #if: {{{urlComments|}}} | *{{{urlComments}}} }}
{{ #if: {{{urlComments|}}} | {{{urlComments}}} }}
+
*'''Access Restrictions:''' {{{accessRestrictions}}}</includeonly>
 
 
The database spans {{{startDate}}} and runs to {{ #if: {{{endDate|}}} | {{{endDate}}} | current day}}.
 
 
 
The server updates from {{{updateSource}}} every {{{updateFrequency}}}. The server is located in {{{serverLocation}}}.
 
 
 
{{{accessRestrictions}}}
 
 
 
Contact: {{ #if: {{{contactAccount|}}} | [[User:{{{contactAccount}}}|{{{contactAccount}}}]] | Unknown }}
 
</includeonly>
 
 
<noinclude>
 
<noinclude>
  
Line 35: Line 32:
 
* '''accessRestrictions''': Public? Ask first? Limit to queries? Put it in in plain english.
 
* '''accessRestrictions''': Public? Ask first? Limit to queries? Put it in in plain english.
 
* '''contactAccount''': The wiki account that you can contact with regard to this source.
 
* '''contactAccount''': The wiki account that you can contact with regard to this source.
 +
** '''contactEmail''': If no wiki contact is available, provide an email address instead.
  
 
== Example ==
 
== Example ==

Latest revision as of 02:16, 24 May 2008


Description

This is used to render entries on the Dow Jones Industrial Average page.

Valid Fields

Valid fields are:

  • hostname: The hostname (eg: irc.peeron.net, xkcd.nucleardog.com)
  • url: The URL to retrieve the value at using tokens as described on the Dow Jones Industrial Average page to show where to place the year/month/day/etc.
  • urlComments (optional): Comments about the URL, such as "Leading zeros are not significant." or "Pass the GET variable X to accomplish function Y."
  • startDate: When the source's records start at.
  • endDate (optional): When the records end at or leave it out of the source is still updating and kept current.
  • updateSource: The hostname from which the source retrieves it's DJI value (eg: finanace.google.com)
  • updateFrequency: The frequency with which the host is updated.
  • serverLocation: Where (geographically) the server is located.
  • accessRestrictions: Public? Ask first? Limit to queries? Put it in in plain english.
  • contactAccount: The wiki account that you can contact with regard to this source.
    • contactEmail: If no wiki contact is available, provide an email address instead.

Example

xkcd.nucleardog.com
Date Range:1970-01-02 - present
Update Source:finance.google.com
Update Frequency:hour
Server Location:Texas, United States
Contact:NuclearDog

The source can be accessed at:

http://xkcd.nucleardog.com/getdow.php?year=%Y&month=%m&day=%d
  • Leading zeros are not significant in year, month and day values. If you request a date which has no value it will return the string 'null'. If you would like to avoid it returning 'null' when requesting days such as weekends, you may pass the GET variable 'compensate' with any value, which will cause it to work backwards from any non-existent days until it finds one with a value and return that instead.
  • Access Restrictions: Free for anyone to use up to a reasonable volume. If you need to make tens of thousands of requests daily, feel free to contact me and I'll send you a dump of the database and the update script.