Difference between revisions of "Template:DJISource"

From Geohashing
imported>NuclearDog
imported>Tjtrumpet2323
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== {{{hostname}}} ==
+
<includeonly>
 +
<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>
 +
<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>
  
This source provides values at:
+
The source can be accessed at:
 +
{{{url}}}
 +
{{ #if: {{{urlComments|}}} | *{{{urlComments}}} }}
 +
*'''Access Restrictions:''' {{{accessRestrictions}}}</includeonly>
 +
<noinclude>
  
{{{url}}}
+
== Description ==
 +
 
 +
This is used to render entries on the [[Dow Jones Industrial Average]] page.
  
{{ #ifeq: {{{urlComments|}}} | {{{urlComments}}} }}
+
== Valid Fields ==
  
The database spans {{{startDate}}} and runs to {{ #ifeq: {{{endDate|}}} | {{{endDate}}} | current date}}.
+
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.
  
The server updates from {{{updateSource}}} every {{{updateFrequency}}}. The server is located in {{{serverLocation}}}.
+
== Example ==
  
{{{accessRestrictions}}}
+
{{DJISource
 +
|hostname=xkcd.nucleardog.com
 +
|url=http://xkcd.nucleardog.com/getdow.php?year=%Y&month=%m&day=%d
 +
|urlComments=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.
 +
|startDate=1970-01-02
 +
|updateSource=finance.google.com
 +
|updateFrequency=hour
 +
|serverLocation=Texas, United States
 +
|accessRestrictions=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.
 +
|contactAccount=NuclearDog}}
  
Contact: [[User:{{{contactAccount}}}]]
+
</noinclude>

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.