Difference between revisions of "Implementations/Web services"

From Geohashing
imported>Relet
(JSON Web Service: +random nick generator #geohashing)
 
(8 intermediate revisions by 3 users not shown)
Line 3: Line 3:
  
 
=== RSS/Atom ===
 
=== RSS/Atom ===
==== geohash.info ====
+
==== Phyzome's feed ====
 
{{30w compliant|yes=1}}
 
{{30w compliant|yes=1}}
 
Subscribe to a feed that updates as soon as each day's meetup is calculable for your graticule:
 
Subscribe to a feed that updates as soon as each day's meetup is calculable for your graticule:
  http://www.geohash.info/srv/feed.php?lat=LAT&lon=LON
+
  https://lab.brainonfire.net/geohash.info/srv/feed.php?lat=LAT&lon=LON
  
If you [http://www.geohash.info/srv/feed.php visit the URL with no parameters], you will be prompted for your graticule coordinates.
+
If you [https://lab.brainonfire.net/geohash.info/srv/feed.php visit the URL with no parameters], you will be prompted for your graticule coordinates.
  
 
* Dow data comes from the [[Dow#carabiner.peeron.com|peeron service]]
 
* Dow data comes from the [[Dow#carabiner.peeron.com|peeron service]]
Line 29: Line 29:
 
* For any bug reports or other features requests, please [mailto:matthew@kerwin.net.au?subject=Geo+Hashing+RSS email Matty]
 
* For any bug reports or other features requests, please [mailto:matthew@kerwin.net.au?subject=Geo+Hashing+RSS email Matty]
 
* Sources can be made available by request.  Although [[User:Mattyk|Matty]] might be a little ashamed of the shoddy code.
 
* Sources can be made available by request.  Although [[User:Mattyk|Matty]] might be a little ashamed of the shoddy code.
 
==== GeoRSS feed ====
 
{{30w compliant|no=1}}
 
You can subscribe to a feed (in GeoRSS format) that will give you updates on a daily basis{{fact}}.  Updates include the "best guess" address of the location as well as the specific latitude/longitude coordinates.
 
<pre>http://atlas.freshlogicstudios.com/Features/Experiments/Xkcd/Xkcd.ashx?Latitude=38&Longitude=-91</pre>
 
 
For example, here's the [http://atlas.freshlogicstudios.com/Features/Experiments/Xkcd/Xkcd.ashx?Latitude=38&Longitude=-91 GeoRSS geohash for St. Louis].
 
 
This GeoRSS feed is used to power the [http://atlas.freshlogicstudios.com/?Xkcd Atlas geohash implementation].
 
 
==== Atom feed ====
 
{{30w compliant|yes=1}}
 
You can subscribe to a feed that will give you updates on a daily basis:
 
<pre>http://staticfree.info/geohash/atom/LAT,LON</pre>
 
 
For example, here's the [http://staticfree.info/geohash/atom/42,-71 Atom Geohash for Boston].
 
 
Just put your coordinates in, subscribe and you'll be ready to go!
 
 
Source is available from subversion: https://staticfree.info/svn/ghfeed/
 
 
;Bugs
 
* I noticed yesterday that before the stock exchange data becomes available, the atom feed creates a kind of 'intemediary' geohash using todays date and yesterday's data. This might be intentional, but personally I find that undesirable on weekdays. Could it be modified to show yesterday's date and geohash until data is available? Nicktaylor 14:04, 23 May 2008 (UTC)
 
** It's definitely broken. -- [[User:Phyzome|Phyzome]] 11:37, 28 May 2008 (UTC)
 
*** This implementation was written before the [[30W]] rule.  As it turns out, the intermediate hash falls back on the previous Dow while using the current date from 00:00 (local) to 09:30 [[ET]], which happens to be the desired 30W behavior.  However, this is not helpful west of 30W.  An inverse problem occurs after 09:30 US[[ET]] east of 30W, until 24:00 local.  See detailed discussion at [[Talk:Implementations#Atom feed 30W-compliance]].  --[[User:Tjtrumpet2323|Tim P]] 15:45, 29 May 2008 (UTC)
 
 
== JSON Web Service ==
 
{{30w compliant|yes=1}}
 
A geohashing JSON web service is available at:
 
<tt><nowiki>http://relet.net/geo</nowiki></tt>
 
 
Additional data may always be present in the replies. This service may be extended in the future.
 
 
[[File:Flattr-badge-large.png|link=http://flattr.com/thing/590693/Geohashing-Web-Service]]
 
 
; Get geohash for location and date / Get graticule statistics
 
<tt><nowiki>http://relet.net/geo/[lat]/[lon]/[YYYY-mm-dd]</nowiki></tt> ([http://relet.net/geo/60/10/2008-05-27 example])<br/>
 
<tt><nowiki>http://relet.net/geo/[lat]/[lon]</nowiki></tt> ([http://relet.net/geo/60/10 example])
 
 
Returns a geohash for the given latitude, longitude and date. If you omit the date, you will only receive the graticule data.
 
 
The output will contain the following values in a dictionary:
 
* error - if an error occurred retrieving the data - example: "DJIA for 2011-12-24 not available yet."
 
* exception - if an error occurred parsing the input or calculating the output - example: "time data '2011-13-24' does not match format '%Y-%m-%d'"
 
or:
 
* djia - DJIA as retrieved from geo.crox
 
* lat - latitude of the geohash
 
* lon - longitude of the geohash
 
* global-lat - latitude of the globalhash
 
* global-lon - longitude of the globalhash
 
and some information about the graticule:
 
* graticule - name of the graticule (may be null)
 
* attempt - number of geohashes attempted
 
* success - number of successful geohashes
 
* last - last successful geohash (may be null)
 
* 30d - geohashes in the last 30 days
 
* 300d - geohashes in the last 300 days
 
* hashers - an estimate on how many hashers have tried to reach geohashes in this graticule
 
 
; Get geohash history for a graticule
 
<tt><nowiki>http://relet.net/geo/list/[lat]/[lon]</nowiki></tt> ([http://relet.net/geo/list/60/10 example])
 
 
Returns a list of past expeditions for this graticule. Each list item contains the values:
 
* lat - latitude of the geohash
 
* lon - longitude of the geohash
 
* djia - relevant DJIA
 
* reached - whether the coordinates were reached
 
* title - the title of the expedition page on http://geohashing.org
 
 
; Get geohash history for a user
 
<tt><nowiki>http://relet.net/geo/follow/User</nowiki></tt> ([http://relet.net/geo/follow/Felix%20Dance example])
 
 
Requires proper capitalization as in wiki user names
 
Returns a list of past expeditions for this users. Each list item contains the values:
 
* lat - latitude of the geohash
 
* lon - longitude of the geohash
 
* djia - relevant DJIA
 
* title - the title of the expedition page on http://geohashing.org
 
* reached - whether the coordinates were reached
 
 
; Get participants of an expedition
 
<tt><nowiki>http://relet.net/geo/participants/lat/lon/date</nowiki></tt> ([http://relet.net/geo/participants/42/-71/2008-06-07 example])
 
 
Returns a list of recognized user names who are presumed to have participated in this expedition. (Fuzzy logic, it's an educated guess)
 
 
; Get complete list of all graticules
 
<tt><nowiki>http://relet.net/geo/grats</nowiki></tt>
 
 
Returns a dictionary of all named graticules. Please store this locally, the transfer size is considerable.
 
For occasional queries after a graticule name, use one of the other APIs. Updated occasionally.
 
 
; Get complete geohashing statistics
 
<tt><nowiki>http://relet.net/geo/stats</nowiki></tt>
 
 
Returns a dictionary with graticule statistics. Updated daily. The data is unlabeled, to save a bit on space.
 
Each dictionary entry is a list with the following entries, in this order.
 
* total expeditions
 
* coordinates reached
 
* 30 day expedition count
 
* 300 day expedition count
 
* last expedition date
 
* number of geohashers having participated in expeditions in this graticule (estimate from parsing reports)
 
 
; Join the #geohashing IRC channel with a random geonick
 
<tt><nowiki>http://relet.net/geo/randomnick</nowiki></tt>
 
 
Generates a HTTP 302 Redirect to mibbit. Just a gimmick for the front page.
 
  
 
== Automatic Daily Notifications ==
 
== Automatic Daily Notifications ==
 
After registering, it will automatically notify users about all hashpoints as soon as they become available.  Graticules are divided into 100 sub-graticules to allow users to only be notified when a hashpoint is near home, or alternatively, for all accessible hashpoints in a graticule.  For more information, see the [[User:Aperfectring/Notification|program's page]].
 
After registering, it will automatically notify users about all hashpoints as soon as they become available.  Graticules are divided into 100 sub-graticules to allow users to only be notified when a hashpoint is near home, or alternatively, for all accessible hashpoints in a graticule.  For more information, see the [[User:Aperfectring/Notification|program's page]].
 
+
[[Category:Implementations]]
== Text Messaging (email) service ==
 
{{30w compliant|yes=1}}
 
If your cell phone supports text messaging to an email address, you can get geohash updates on your phone by sending a formatted text to srv@geohash.info
 
;Formatting
 
YYYY-MM-DD Lat Lon
 
Example:
 
<pre>2008-02-18 42 -83</pre>
 
Alternatively, it defaults to the current date (EST for now) and you can just enter Latitude and Longitude
 
<pre>42 -83</pre>
 
 
 
;Bugs
 
* The [[-0 Issue]] is still very much an issue.
 
* This used to display the degree symbol after coordinate elements, but due to poor cell phone support of this character, which resulted in messages cutting off after the first Latitude, I have removed it.
 
* This is also not a terribly robust solution, but a better (stronger, faster) implementation is in the making.
 
* Not necessarily a bug, but a desirable feature: it would be nice to be able to omit the '-' character when specifying the date (it just happens to require many keystrokes to type - on my phone)
 
 
 
== Text Messaging service (SMS) ==
 
{{30w compliant|yes=1}}
 
Text "GH [date]" to +41774378210, eg:
 
<pre>gh 20091110</pre>
 
A few seconds later you should get an sms response similar to the following:
 
<pre>Relevant DJIA for 2009-11-10 is 10223.01(W) / 10020.62(E). Decimal parts are: 0.02335 0.228005(W) / 0.854495 0.149983(E).</pre>
 
 
 
Occasionally you may see a result of '''<n/a>''' when information is unavailable. For example, if you are looking at a date where coordinates are only available east of w30, you may see something like:
 
<pre>Relevant DJIA for 2009-11-10 is <n/a>(W) / 10020.62(E). Decimal parts are: <n/a>(W) / 0.854495 0.149983(E).</pre>
 
 
 
Not case-sensitive, so "Gh", "gh" etc. are all fine. Don't forget the space between "gh" and the date. The script is also flexible on the date format as long as it's in the Y-m-d order.
 
 
 
The service uses the [[Dow_Jones_Industrial_Average#geo.crox.net|DJIA source]] that I maintain.
 
 
 
I recommend testing it once before you are away from home and really need it. Also, don't hesitate to tell me if you don't get an sms back or if you feel that something else is not working properly...
 
 
 
See also [[Dow Jones Industrial Average#SMS|SMS DJIA service]]; suggestions, comments and other feedback to [[User:Crox]].
 
 
 
== Email autoresponder ==
 
{{30w compliant|yes=1}}
 
 
 
Email or text srv@geohash.info with something like <code>2008-3-25 42 -71</code> in the body to get geohash coordinates. Send "usage" to get this same info in the field.
 
 
 
* Source code: https://github.com/timmc/hashflash
 
* Maintainer: [[User:Phyzome|Phyzome]]
 

Latest revision as of 18:54, 14 January 2022

DJIA sources

See: Dow Jones Industrial Average for a list of data sources for the DJIA openings.

RSS/Atom

Phyzome's feed

This implementation IS FULLY 30W-compliant.

Subscribe to a feed that updates as soon as each day's meetup is calculable for your graticule:

https://lab.brainonfire.net/geohash.info/srv/feed.php?lat=LAT&lon=LON

If you visit the URL with no parameters, you will be prompted for your graticule coordinates.

  • Dow data comes from the peeron service
  • To view source, drop the parameters and change the extension to .phps -- this currently works for all PHP files in geohash.info/srv/
Quirks
  • The script estimates your timezone based upon your longitude, and uses -04:30 as the timezone of the Dow. Therefore, the update times may be off by as much as an hour or two. Shouldn't be an issue, since they'll be around midnight for most people.
  • For non-30W users, the feed will be empty between midnight and 9:30 AM -- this should be acceptable, since most feed readers keep entries that have dropped off the end of the feed. (This behavior may be changed in the future.)

Geo Hashing RSS

This implementation IS FULLY 30W-compliant.

Another RSS implementation, coded by Matty K. This one simply provides a graticule's coordinates for a given day, and gives links to both Google maps and the peeron maplet. It is recalculated at every request (so please don't hammer it, or my website will run out of bandwidths).

http://geohashing.kerwin.net.au/rss.php?ll=LAT,LON

For example, the link for San Francisco's feed is: http://geohashing.kerwin.net.au/rss.php?ll=37,-122

Notes:

  • If latitude/longitude are not given, it defaults to my home graticule .
  • I don't know if it supports negative zero. If there is a request to add specific support, please let me know. I added specific negative zero support, and tested it with the London area. It appeared to work okay.
  • 30W-compliance is based on the fact that I live East of 30W, and it gives me the right coordinates each day.
  • For any bug reports or other features requests, please email Matty
  • Sources can be made available by request. Although Matty might be a little ashamed of the shoddy code.

Automatic Daily Notifications

After registering, it will automatically notify users about all hashpoints as soon as they become available. Graticules are divided into 100 sub-graticules to allow users to only be notified when a hashpoint is near home, or alternatively, for all accessible hashpoints in a graticule. For more information, see the program's page.