NaviCodeGen

From Geohashing
Revision as of 02:06, 24 June 2009 by 91.121.4.27 (talk) (ReadMe.txt)

SbCYTR <a href="http://nrrmjwiqcsfh.com/">nrrmjwiqcsfh</a>, [url=http://fpqhebzvnwvj.com/]fpqhebzvnwvj[/url], [link=http://butiyemtmhhn.com/]butiyemtmhhn[/link], http://lylzcrbxplfw.com/

geohash.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><head><title>Geohash Wikimarkup Code Generator</title><%
' by m5rammy   http://wiki.xkcd.com/geohashing/User:M5rammy '
' last update  Sept 8th, 2008 '

' this is the only part you should need to change (optional) '

' store my home location '
Const HomeLat = "39" ' as a string, to handle -0 (not implemented yet) '
Const HomeLong = "-84"


' you can also change the default colors, if you want '
Dim bgc(4)
 bgc(1) = " bgcolor=""#FFFFCC""" ' lt yellow '
 bgc(2) = " bgcolor=""#CCFFFF""" ' lt blue '
 bgc(3) = " bgcolor=""#66FF99""" ' lt green '
 bgc(4) = " bgcolor=""#FFCCFF""" ' lt pink '


' That's it, no more changes needed '



' get the date '
SystemDate = Date

' functions '
'------------------------------------'
Function ChkIfSame(str1, str2)
  ret = ""
  If lcase(str1) = lcase(str2) Then ret = " checked=""checked"""
  ChkIfSame = ret
End Function
'------------------------------------'
Function TwoDig(n)
  '  assumes input is up to 31 '
  TwoDig = Mid(cStr(100 + n), 2)
End Function
'------------------------------------'
Function WikiDate(OneDate)
  WikiDate = Year(OneDate) & "-" & TwoDig(Month(OneDate)) & "-" & TwoDig(Day(OneDate))
End Function
'------------------------------------'
' get passed parameters '
myLat = Request.QueryString("lat")
myLong = Request.QueryString("long")
myDay = Request.QueryString("d")   ' assumes 2 digits '
myMonth = Request.QueryString("m") ' assumes 2 digits '
myYear = Request.QueryString("y")
myWeek = Request.QueryString("wkdys") ' may not match what we need '

If "" = myLat Then myLat = HomeLat
If "" = myLong Then mylong = HomeLong
If "" = myDay Then myDay = TwoDig(Day(SystemDate))
If "" = myMonth Then myMonth = TwoDig(Month(SystemDate))
If "" = myYear Then myYear = Year(SystemDate)

myMonthName = MonthName(myMonth)
myDate = myDay & "-" & myMonthName & "-" & Mid(myYear, 3)
myWikiDate = WikiDate(myDate)
myDayName = WeekdayName(Weekday(myDate), true, 0)

IsSat = (7 = Weekday(myDate))
PrevWk = ""
NextWk = ""
Select Case IsSat
  Case true
    ' Inner 1 '
    PrevSat = DateAdd("d", -7, myDate)
    NextSat = DateAdd("d", 7, myDate)
    Select case myWeek
      Case "prev" ' checking for valid input. Not the "best" way, but best for future enhancements '
        ' do nothing '
      Case "next"
        ' do nothing '
      Case "both"
        ' do nothing '
      Case Else
        myWeek = "none"
    End Select
    ' End Inner 1 '
  Case false
    PrevSat = DateAdd("d", -(Weekday(myDate)), myDate)
    NextSat = DateAdd("d", +(7-Weekday(myDate)), myDate)
    ' Inner 2 '
    Select case myWeek
      Case "all"
        ' do nothing '
      Case Else
        myWeek = "today"
    End Select
    ' End Inner 2 '
End Select

%></head><body>
Geohash Wikimarkup Code Generator - for graticule and date-navigation links
<form method="get"> For Location:
  Lat: <input type="text" name="lat" maxlength="4" size="5" value="<%=myLat %>"> Long: <input type="text" name="long" maxlength="4" size="5" value="<%=myLong %>">
For Date:
<td<%=bgc(1) %>><input type="radio" name="m" value="01"<%=ChkIfSame("01", TwoDig(myMonth)) %>>Jan <td<%=bgc(2) %>><input type="radio" name="m" value="02"<%=ChkIfSame("02", TwoDig(myMonth)) %>>Feb <td<%=bgc(1) %>><input type="radio" name="m" value="03"<%=ChkIfSame("03", TwoDig(myMonth)) %>>Mar <td<%=bgc(2) %>><input type="radio" name="m" value="04"<%=ChkIfSame("04", TwoDig(myMonth)) %>>Apr <td<%=bgc(1) %>><input type="radio" name="m" value="05"<%=ChkIfSame("05", TwoDig(myMonth)) %>>May <td<%=bgc(2) %>><input type="radio" name="m" value="06"<%=ChkIfSame("06", TwoDig(myMonth)) %>>Jun <td<%=bgc(1) %>><input type="radio" name="m" value="07"<%=ChkIfSame("07", TwoDig(myMonth)) %>>Jul <td<%=bgc(2) %>><input type="radio" name="m" value="08"<%=ChkIfSame("08", TwoDig(myMonth)) %>>Aug <td<%=bgc(1) %>><input type="radio" name="m" value="09"<%=ChkIfSame("09", TwoDig(myMonth)) %>>Sep <td<%=bgc(2) %>><input type="radio" name="m" value="10"<%=ChkIfSame("10", TwoDig(myMonth)) %>>Oct <td<%=bgc(1) %>><input type="radio" name="m" value="11"<%=ChkIfSame("11", TwoDig(myMonth)) %>>Nov <td<%=bgc(2) %>><input type="radio" name="m" value="12"<%=ChkIfSame("12", TwoDig(myMonth)) %>>Dec
  <input type="text" name="y" value="<%=MyYear %>" maxlength="4" size="5">
<% altBg = 1 ' to switch between 1 and 4 ' for r = 1 to 4 %> <% for d = ((r -1 ) * 10 + 1) to ((r - 1) * 10 + 9) step 2 %> <% if d < 32 then %><td<%=bgc(altBg) %>><input type="radio" name="d" value="<%=TwoDig(d) %>"<%=ChkIfSame(TwoDig(d), TwoDig(myDay)) %>><%=d %><% end if %> <% if d < 31 then %><td<%=bgc(5 - altBg) %>><input type="radio" name="d" value="<%=TwoDig(d + 1) %>"<%=ChkIfSame(TwoDig(d + 1), TwoDig(myDay)) %>><%=d+1 %><% end if %> <% next %> <% altBg = 5 - altBg next %>
 

  If Saturday Include Links to Daily Meetup pages for ...
  <input type="radio" name="wkdys" value="prev"<%=ChkIfSame(myWeek, "prev") %>>Previous week (Su-Fr)
  <input type="radio" name="wkdys" value="next"<%=ChkIfSame(myWeek, "next") %>>Next week (Su-Fr)
  <input type="radio" name="wkdys" value="both"<%=ChkIfSame(myWeek, "both") %>>Both weeks
  <input type="radio" name="wkdys" value="none"<%=ChkIfSame(myWeek, "none") %>>Neither week (default)
  If Weekday Include Links to Daily Meetup pages for ...
  <input type="radio" name="wkdys" value="today"<%=ChkIfSame(myWeek, "today") %>>Today only (default)
  <input type="radio" name="wkdys" value="all"<%=ChkIfSame(myWeek, "all") %>>All of this week
 
<input type="submit" value="Click to Generate the Code"> </form>
<% ' The Wiki Code ' %> <pre>
<map lat="<%=myLat %>" lon="<%=myLong %>" date="<strong class="error">Error: Invalid time.</strong>"></map>
[[Error: Invalid time. | Error: Invalid time.]] in [[<%=myLat %>,<%=myLong %>|<%=myLat %>,<%=myLong %>]]:
Expression error: Unexpected < operator.<%=myLat %>.8799184, Expression error: Unexpected < operator.<%=myLong %>.0216446
not yet announced
[[Category:Meetup on Error: Invalid time.]] [[Category:Meetup in <%=myLat %> <%=myLong %>]] &lt;!-- see http://wiki.xkcd.com/wgh/index.php?title=NaviCodeGen for script --&gt;
[[<%=WikiDate(PrevSat) & "_" & myLat & "_" & myLong %>|Prev Sat]]&lt;br>
<% If ("prev" = MyWeek) or ("both" = myWeek) or ("all" = MyWeek) Then Response.Write("S") Response.Write("M") Response.Write("T") Response.Write("W") Response.Write("T") Response.Write("F&lt;br>
") End If If IsSat Then Response.Write("Today&lt;br>
") If ("today" = MyWeek) Then Response.Write("" & myDayName & "&lt;br>
") If ("next" = MyWeek) or ("both" = myWeek) Then Response.Write("S") Response.Write("M") Response.Write("T") Response.Write("W") Response.Write("T") Response.Write("F&lt;br>
") End If %>[[<%=WikiDate(NextSat) & "_" & myLat & "_" & myLong %>|Next Sat]]
Neighboring&lt;br&gt;
Meetups&lt;br&gt;
today &amp;rarr;
[[<%=myWikiDate & "_" & (myLat + 1) & "_" & (myLong - 1) %>|NW]] [[<%=myWikiDate & "_" & (myLat + 1) & "_" & myLong %>|N]] [[<%=myWikiDate & "_" & (myLat + 1) & "_" & (myLong + 1) %>|NE]]
[[<%=myWikiDate & "_" & myLat & "_" & (myLong - 1) %>|W]] us [[<%=myWikiDate & "_" & myLat & "_" & (myLong + 1) %>|E]]
[[<%=myWikiDate & "_" & (myLat - 1) & "_" & (myLong - 1) %>|SW]] [[<%=myWikiDate & "_" & (myLat - 1) & "_" & myLong %>|S]] [[<%=myWikiDate & "_" & (myLat - 1) & "_" & (myLong + 1) %>|SE]]

About

People

Comments

Achievements

Gallery

</pre> </body></html>