;=tXIEV»rĻž½ś’  "; Gn zæ ÄŠ½ś’Ü äauthor Mikel Maron authorEmailmikel_maron@yahoo.com description#add location data to weblog entries homePageUrlAhttp://rockburger.com/brainoff.com/worldkit/doc/weblogs.php#radionameLocation releaseDateversion0.3Iŗœ¦Arial »rŠ:½ś ›)JżLAND’’’’’’winon afterWeblogPostForm (adrPost) local pta = html.getPageTableAddress() text = "" lon = "" lat = "" imgurl = "" try if (pta^.method == "POST") if (adrPost != nil) if defined (pta^.radioResponder.postArgs.lat) && sizeOf(pta^.radioResponder.postArgs.lat) > 0 adrPost^.lat = pta^.radioResponder.postArgs.lat if defined (pta^.radioResponder.postArgs.lon) && sizeOf(pta^.radioResponder.postArgs.lon) > 0 adrPost^.lon = pta^.radioResponder.postArgs.lon if defined (pta^.radioResponder.postArgs.imgurl) && sizeOf(pta^.radioResponder.postArgs.imgurl) > 0 adrPost^.imgurl = pta^.radioResponder.postArgs.imgurl else if (adrPost != nil) if defined (adrPost^.lat) && sizeOf(adrPost^.lat) > 0 lat = adrPost^.lat if defined (adrPost^.lon) && sizeOf(adrPost^.lon) > 0 lon = adrPost^.lon if defined (adrPost^.imgurl) && sizeOf(adrPost^.imgurl) > 0 imgurl = adrPost^.imgurl text = "Latitude:   Longitude:   Thumbnail url: " return text €€€€€€€€€€€€€€€€€€€€€€€€€€ŗ…<ŃArial »rŠN½ś ō&JżLAND’’’’’’winon writeRssItemElement (adrtable, adrpost=nil) if defined (adrPost^.lat) && sizeOf(adrPost^.lat) > 0 adrtable^.["geo:lat"] = adrPost^.lat if defined (adrPost^.lon) && sizeOf(adrPost^.lon) > 0 adrtable^.["geo:long"] = adrPost^.lon if defined (adrPost^.imgurl) && sizeOf(adrPost^.imgurl) > 0 adrtable^.["photo:thumbnail"] = adrPost^.imgurl else if defined (adrPost^.link) && sizeOf(adrPost^.link) > 0 adrtable^.["photo:thumbnail"] = adrPost^.link €€€€€€€„€€…+”Arial »rÓ„½ś JżLAND’’’’’’winon writeRssNamespace (spacetableaddress) spacetableaddress^.["geo"] ="http://www.w3.org/2003/01/geo/" spacetableaddress^.["photo"] = "http://pheed.com/pheed/" €€€+”.»rĻ»rÕS  4@ RafterWeblogPostForm­writeRssItemElementswriteRssNamespace ”3/»rĻ»rх user ;3ZxjArial »só÷»söPJżLAND’’’’’’winChanges Created from installCodeFreshener script by AJF on 8/28/2003; 6:02:28 PM. 9/26/02; 12:23:22 AM by AJF Add new tool tables. 1/15/02; 5:21:20 PM by DW Runs on the user's machine, when refreshing. local (adrtable = @system.temp.LocationSnapshot) LocationInfo = adrtable^.info LocationSuite = adrtable^.suite LocationThread = adrtable^.thread LocationWebsite = adrtable^.website filemenu.savemyroot (@LocationSuite) local (x=string.parseAddress (@LocationSuite), f = x[1]) frontier.tools.install (f) dialog.notify ("Thanks for updating to version " + LocationInfo.version + " of Location.root Tool!") „€€€€€€€€€€€€€€€€€€€Z½N÷Arial »sō4½ś6JżLAND’’’’’’winChanges Created from installCodeFreshener script by AJF on 8/28/2003; 6:02:30 PM. 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://brainoff.com/worldkit/download/locationCodeFreshener.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f=frontier.pathstring + "codeFreshener.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.LocationSnapshot.loader, {}) „€€€€€€€€€€€€½ń mArial »sō5»sō6JżLAND’’’’’’winif dialog.confirm ("Get the newest code for Location.root Tool?") LocationSuite.codeFreshener.refreshCode() €€ńŪ¢ĮArial »sō6»s÷»[łLAND’’’’’’winChanges Created from installCodeFreshener script by AJF on 8/28/2003; 6:02:31 PM. 1/15/02; 5:08:55 PM by DW Created. I run this on my machine to create a package for refreshCode to load. Talk about a Mobius Strip. It's really simple code, but it's fun to walk your mind through it. LocationThread.enabled = true LocationThread.ct = 0 LocationInfo.releaseDate = clock.now() local (adrtable = @system.temp.LocationSnapshot) new (tabletype, adrtable) adrtable^.info = LocationInfo adrtable^.suite = LocationSuite adrtable^.thread = LocationThread adrtable^.website = LocationWebsite adrtable^.loader = LocationSuite.codeFreshener.loadNewCode local (f = radio.file.getSubFolder ("gems") + "locationCodeFreshener.fttb") file.surefilepath (f) export.sendobject (adrtable, f) f = radio.file.getSubFolder ("gems") + "Location.root" target.set (this) fileMenu.saveCopy (f) dialog.alert (file.filefrompath (f) + " is " + string.megabytestring (file.size (f))) „€€€€€€€€€€€€€€€€€€€€€€€€€€Ū§£8»só÷»sō6  $0 @L [ loadNewCode  refreshCode€refreshCodeMenuIreleaseNewCodeF§x.Arial »rÓ,»rāšJżLAND’’’’’’winon install () if( !defined( user.radio.callbacks.afterWeblogPostForm ) ) radio.log.add( "Location", "afterWeblogPostForm callback table is missing", clock.ticks() ) else user.radio.callbacks.afterWeblogPostForm.Location = @LocationSuite.callbacks.user.afterWeblogPostForm if( !defined( user.radio.callbacks.writeRssItemElement ) ) radio.log.add( "Location", "writeRssItemElement callback table is missing", clock.ticks() ) else user.radio.callbacks.writeRssItemElement.Location = @LocationSuite.callbacks.user.writeRssItemElement if( !defined( user.radio.callbacks.writeRssNamespace ) ) radio.log.add( "Location", "writeRssNamespace callback table is missing", clock.ticks() ) else user.radio.callbacks.writeRssNamespace.Location = @LocationSuite.callbacks.user.writeRssNamespace bundle //install macro local (adrMacro = @user.html.macros.locationlink) if ( defined (adrMacro^ ) ) delete ( adrMacro ) script.newScriptObject ("on locationlink(postnum) { LocationSuite.macros.locationlink(postnum) }", adrMacro ) script.compile( adrMacro ) €€€€€€€€€€€€€€€€€€€€`; Arial »rŽy»rģöJżLAND’’’’’’winon locationlink (postnum) local adrblog = radio.weblog.init () adrpost = @adrblog^.posts.[string.padwithzeros(postnum,8)] lat = "" lon = "" imgurl = user.radio.prefs.defaultCloudData.url + "images/remote.gif" if defined (adrpost^) if defined (adrpost^.lat) lat = adrpost^.lat if (defined (adrpost^.lon)) lon = adrpost^.lon if sizeOf(lat) > 0 && sizeOf(lon) > 0 return "" else return "" €€€€€€€€€€€€€€€€;7»rŽi»rŽy locationlink ;ž Arial »rĻ»rĻ÷6æ·LAND’’’’’’windialog.notify ("Hello, World!") €žŌVArial »sō7»sō7÷6æ·LAND’’’’’’winif dialog.confirm ("Get the newest code?"){LocationSuite.codeFreshener.refreshCode()} €Ōõ&WArial »rĻ»sō7X÷6æ·LAND’’’’’’winLocation Use the Location Tool from your Weblog Post form -- Cheers! Refresh Code... €€ !p€ "õp"ś°ĖArial ukś/p$  Arial »rĻž»rŃĄJżLAND’’’’’’winThis script returns a string which appears in the Status Center on the Radio UserLand home page. return ("Add Location Information to Individual Weblog Posts") „€$ÜŲL»rĻ»só÷  $0 8D KW \h | callbacks Ū codeFreshener-installąmacros!)menu#ūstatusCenterMessage$wܬx¼Arial »rĻž»rÓ˜å]žLAND’’’’’’winThis script runs in its own thread. local startTime = clock.ticks() radio.weblog.init() bundle //install process radio.log.add("Location","Triggering Install", startTime) if (! defined(system.temp.flLocationInstalled) ) try radio.log.add("Location", "Firing Install", startTime) LocationSuite.install() system.temp.flLocationInstalled = true radio.log.add("Location", "Install Complete", startTime ) else radio.log.add("Location", tryError, startTime) else radio.log.add("Location", "Install flag already set", startTime ) bundle //while the application is running loop //loop until the application quits Add your code here. thread.sleepFor (10) //sleep for ten seconds „€€€€€€€€€€€€€€€€€„€¬TP.»rĻž½ś’’’ ctenabledscript&Tn»s’ VArial nÅV“ž†  "+ 0: CL Q[ aalink008000bgcolorFFFFFFflRenderlink0000FFspaceGifspacetext000000vlink800080VArial d<°Arial ¶Fū¶FūµßiLAND’’’’’’win {title} {metaTags ()} {bodyTag ()} {bodytext} €€€€€€€€€€dn»s‘īVArial nFFFF000000060001001777AA000000000059000000001001710180490021800000‚‚600060031B8200-1‚0Ā3‚1B8273FFFF0‚‚1000010000003B00000001037940840‚‚3‚1B827335F048C0001A531B8C4000020000037F00000000379,#title "" This tool enables geotagging of individual weblog postings.

Below the post editing box, there are inputs for latitude and longitude. A good site to find lat/lon coords is maporama. The lat/lon coords should be entered in "decimal" form.

In the weblog's RSS file, the item will list the latitude and longitude in the "geo" namespace...

<item>
<description>Brighton, UK is a laid back town.</description>
<geo:lat>50.8351</geo:lat>
<geo:lon>-0.1322</geo:lon>
</item>
You can add a link to a map of the location, in the #itemTemplate, by using this macro: <%locationlink(<%itemNum%>)>

Contact mikel_maron@yahoo.com with any questions or comments.00040000000A00000002037B000050000000A00000002037B0000600000032000000010ĮF310‚‚ĮFFFF0‚C00000Ā 40ĀĮ ‚‚Į‚000700000019000000010Ā‚201E0‚Į‚0008000000AF0000000140,Geneva40,10A0304E44000‚‚104000‚‚10000900000017000000020‚1972B90‚1972B9000A00000017000000023‚1B82733‚1B8273000B00000005000000020Ā000C0000001000000001A‚‚17310‚000F0000005200000000400Ā 10Ā ‚ĀĮĀĮ‚‚ĮĀ4,appn4,send4,8óš4,&4,8ō€4,3©4,8ōš00130000007E00000000DA91F8CE1C1D1E1F7F1B044,-.¶µ•µ„„.'"‘’“”…ƒFFFF0FFFF0FFFE000000060001001777AA±§PÄ»s’½y²DY €ŖBµü7»s‘ł  ) 3? FR X #glossary*§#prefs+! #template,L#tools-¼index.6VVerdana ŗ“??8“ņŪ¦8»rĻ»sųŒ  '3 BN ^ LocationInfoX LocationSuite%§LocationThread*GLocationWebsite6FV°ŗgyKóJ¤æArial »uŸø½śóœ÷6æ·LAND’’’’’’winLocationInfo LocationSuite callbacks codeFreshener loadNewCode refreshCode refreshCodeMenu releaseNewCode install macros menu statusCenterMessage LocationThread LocationWebsite €øœ†x¢†€øœ†x¢†€øœ†X¢†€øœ†X¢†€øœ†Ą˜†€øœ†Ą˜†€øœ†Ą˜†€øœ†Ą˜†€øœ†X¢†€øœ†X¢†€øœ†X¢†€øœ†X¢†€øœ†x¢†€øœ†x¢†Ūŗ7V/¦æArial ’’’’’’’’ MS Sans Serif )hÆTimes New Roman$ .4ˆŗArial =%yÉArial ’’’’’’’’ MS Sans Serif ’’ŗ