yX EuָIYext">GIG QMVEu׸I  "A M I author Jeff Cheney authorEmailfrequencies@cyberviewer.com description0A tool for measuring Radio UserLand frequencies. homePageUrl3http://radio.weblogs.com/0001018/tools/frequencies/name Frequencies releaseDateversion0.3QGeneva 6 6 &?LANDmac This script runs every hour. Geneva 6 6 &?LANDmac This script runs every minute. Geneva 6 6 &?LANDmac This script runs every night. {w.6 6  ". 9 everyHour everyMinute everyNight1{ 6 B6 :4B flFrequenciesDataStale["Macintosh HD:Applications (Mac OS 9):UserLand:Radio UserLand:Tools:frequencies.root"].frequenciesSuite.flFrequenciesDataStale:KB{ flFrequenciesDataStale["Macintosh HD:Applications (Mac OS 9):UserLand:Radio UserLand:Tools:frequencies.root"].frequenciesSuite.flFrequenciesDataStaled`$6 :}  ,upstream@upstreamFileWasDeleted@Qd 6 En nj.6 BS  ' ,fileMenu`radiousern Geneva 6 Fd|&?%LANDmac This script returns a string which appears on the Frequencies page. on categoriesMessage (adrBlog=radio.weblog.init ()) return ("You have created " + frequenciesData.categoryCount + " categories.") a:Geneva (,I>LANDmac on categoryStats (adrblog=radio.weblog.init ()) Changes Sat, Dec 8, 2001 at 5:11:44 PM by JTC modified link to reflect flRenderHtml Tue, Nov 27, 2001 at 9:33:42 PM by JTC original script local (countTable) bundle // initialize the data tables new (tableType, @countTable) local (numberOfCategories = sizeOf (adrblog^.categories)) for i = 1 to numberOfCategories //create a sub-table for each category and initialize values local (categoryName = nameOf (adrblog^.categories[i])) new (longType, @countTable.[categoryName]) countTable.[categoryName] = sizeOf (adrBlog^.categories.[categoryName].storyList) bundle // sort by count local (oldTarget) oldTarget = target.set (@countTable) table.sortBy ("value") target.set (oldTarget) local (adrStatsTable) bundle // save category count for Tool message if not defined (frequenciesData.categoryCount) new (longType, @frequenciesData.categoryCount) frequenciesData.categoryCount = sizeOf (countTable) bundle // initialize html table local border = 1 cellpadding = 3 cellspacing = 0 cols = 6 method = "html" adrStatsTable = html.table.new (border, cellspacing, cellpadding, cols, method) local title = "" type = "string" align = "left" size = "" link = "" flLink = false html.table.addColumn (adrStatsTable, " ", type, "right", size, link, flLink) html.table.addColumn (adrStatsTable, "Category", type, align, size, link, flLink) html.table.addColumn (adrStatsTable, "Description", type, align, size, link, flLink) html.table.addColumn (adrStatsTable, "Last Upload", type, align, size, link, flLink) html.table.addColumn (adrStatsTable, "Items", type, "right", size, link, flLink) html.table.addColumn (adrStatsTable, " ", type, align, size, link, flLink) local (countTableSize = sizeOf (countTable)) for i = countTableSize downTo 1 //loop over collected data and generate html table local adrStatsTableRow category itemCount lastUpload description index xmlLink bundle // initialize local variables adrStatsTableRow = html.table.addRow (adrStatsTable) category = nameOf (countTable[i]) itemCount = countTable.[category] if defined (adrBlog^.categories.[category].dateLastUpload) lastUpload = string.replaceAll (adrBlog^.categories.[category].dateLastUpload, " ", " ") else lastUpload = "Never" description = adrBlog^.categories.[category].description index = sizeOf (countTable) - i + 1 xmlLink = "" + radio.images.systemImageRef ("icons/xml") + "" if adrBlog^.categories.[category].flRenderHtml category = "" + string.replaceAll (adrBlog^.categories.[category].displayName, " ", " ") + "" else category = string.replaceAll (adrBlog^.categories.[category].displayName, " ", " ") adrStatsTableRow^.cells = {index, category, description, lastUpload, itemCount, xmlLink} local (statsTableHTML = html.table.render (adrStatsTable)) bundle // cleanup table.emptyTable (@countTable) html.table.delete (adrStatsTable) bundle // cache results if not defined (frequenciesData.categoriesHtml) new (stringType, @frequenciesData.categoriesHtml) frequenciesData.categoriesHtml = statsTableHTML if not defined (frequenciesData.categoriesModified) new (dateType, @frequenciesData.categoriesModified) frequenciesData.categoriesModified = timeModified (@adrBlog^.categories) return (statsTableHTML) bundle // test code wp.newTextObject (frequenciesSuite.categoryStats (), @scratchpad.categoryStatsHTML) true *Geneva @?B &?LANDmac on flFrequenciesDataStale (fileList) if not defined (frequenciesData.stale) new (booleanType, @frequenciesData.stale) frequenciesData.stale = true return (frequenciesData.stale) bundle // test code flFrequenciesDataStale ({""}) MBGeneva :3IB &?^LANDmac on getCategoryStats (adrblog=radio.weblog.init ()) if defined (frequenciesData.categoriesHtml) if (frequenciesData.categoriesHtml != "") return (frequenciesData.categoriesHtml) else return (categoryStats (adrblog)) else return (categoryStats (adrblog)) bundle // test code wp.newTextObject (frequenciesSuite.getCategoryStats (), @scratchPad.categoryHTML) edit (@scratchPad.categoryHTML) M0Geneva :3:&?^LANDmac on getSourceStats (adrblog=radio.weblog.init ()) if defined (frequenciesData.sourcesHtml) if (frequenciesData.sourcesHtml != "") return (frequenciesData.sourcesHtml) else return (sourceStats (adrblog)) else return (sourceStats (adrblog)) OGeneva 56| &?LANDmac dialog.notify ("Tools to measure Radio UserLand frequencies by Jeff Cheney.") ECharcoal ,QFg&?LANDmac webBrowser.openUrl ("http://127.0.0.1:5335/frequencies/categories/") BCharcoal ,QFg&?LANDmac webBrowser.openUrl ("http://127.0.0.1:5335/frequencies/sources/") <MCharcoal x`B&?LANDmac Frequencies About Frequencies... -------------------- Categories Sources Y 2 !p!0 KCharcoal ^0HphGeneva (,EnmLANDmac on sourceStats (adrblog=radio.weblog.init ()) Tue, Nov 27, 2001 at 9:33:42 PM by JTC local adrPost postCount = 0 sourceCountTable sourceUrlTable bundle // initialize data tables new (tableType, @sourceCountTable) new (tableType, @sourceUrlTable) for adrpost in @adrblog^.posts //loop over posts, and gather source data if defined (adrpost^.sourceName) if not defined (sourceCountTable.[adrpost^.sourceName]) new (longType, @sourceCountTable.[adrpost^.sourceName]) sourceCountTable.[adrpost^.sourceName] = 0 sourceCountTable.[adrpost^.sourceName]++ if not defined (sourceUrlTable.[adrpost^.sourceName]) new (stringType, @sourceUrlTable.[adrpost^.sourceName]) sourceUrlTable.[adrpost^.sourceName] = "" if defined (adrpost^.sourceUrl) sourceUrlTable.[adrpost^.sourceName] = adrPost^.sourceUrl postCount++ bundle // save post count for Tool message if not defined (frequenciesData.postCount) new (longType, @frequenciesData.postCount) frequenciesData.postCount = postCount bundle // save source count for Tool message if not defined (frequenciesData.sourceCount) new (longType, @frequenciesData.sourceCount) frequenciesData.sourceCount = sizeOf (sourceCountTable) bundle // sort by count local (oldTarget) oldTarget = target.set (@sourceCountTable) table.sortBy ("value") target.set (oldTarget) local (adrStatsTable) bundle // initialize html table local border = 1 cellpadding = 3 cellspacing = 0 cols = 5 method = "html" adrStatsTable = html.table.new (border, cellspacing, cellpadding, cols, method) local title = "" type = "string" align = "left" size = "" link = "" flLink = false html.table.addColumn (adrStatsTable, "", type, "right", size, link, flLink) html.table.addColumn (adrStatsTable, "Source", type, align, size, link, flLink) html.table.addColumn (adrStatsTable, "Description", type, align, size, link, flLink) html.table.addColumn (adrStatsTable, "Items", type, "right", size, link, flLink) html.table.addColumn (adrStatsTable, "", type, align, size, link, flLink) local (numberOfSources = sizeOf (sourceCountTable)) for i = numberOfSources downTo 1 //loop over collected data and generate html table local adrStatsTableRow = html.table.addRow (adrStatsTable) source = nameOf (sourceCountTable[i]) itemCount = sourceCountTable.[source] rank = sizeOf (sourceCountTable) - i + 1 sourceUrl = sourceUrlTable.[source] adrCompilation sourceDescription = " " sourceXml = " " if sourceUrl != "" if defined (aggregatorData.services.[sourceUrl]) adrCompilation = @aggregatorData.services.[sourceUrl].compilation source = "" + adrCompilation^.channelTitle + "" if adrCompilation^.channelDescription != "" sourceDescription = adrCompilation^.channelDescription sourceXml = ""+ system.verbs.builtins.radio.images.systemImageRef ("icons/xml") + "" adrStatsTableRow^.cells = {rank, source, sourceDescription, itemCount, sourceXml} local (statsTableHTML = html.table.render (adrStatsTable)) bundle // cleanup table.emptyTable (@sourceCountTable) table.emptyTable (@sourceUrlTable) html.table.delete (adrStatsTable) bundle // cache results if not defined (frequenciesData.sourcesHtml) new (stringType, @frequenciesData.sourcesHtml) frequenciesData.sourcesHtml = statsTableHTML return (statsTableHTML) bundle // test code wp.newTextObject (frequenciesSuite.sourceStats (), @scratchpad.sourceStatsHTML) true /Geneva :qEtZeLANDmac on startup (adrBlog=radio.weblog.init ()) bundle // initialize callbacks bundle // initialize upstream if not defined (user.radio.callbacks.upstream.flFrequenciesDataStale) new (addressType, @user.radio.callbacks.upstream.flFrequenciesDataStale) table.assign (@user.radio.callbacks.upstream.flFrequenciesDataStale, @frequenciesSuite.flFrequenciesDataStale) bundle // initialize upstreamFileWasDeleted if not defined (user.radio.callbacks.upstreamFileWasDeleted.flFrequenciesDataStale) new (addressType, @user.radio.callbacks.upstream.flFrequenciesDataStale) table.assign (@user.radio.callbacks.upstreamFileWasDeleted.flFrequenciesDataStale, @frequenciesSuite.flFrequenciesDataStale) bundle // initialize data bundle // initialize Category data if not defined (frequenciesData.categoriesHtml) new (stringType, @frequenciesData.categoriesHtml) frequenciesData.categoriesHtml = "" if frequenciesData.categoriesHtml == "" frequenciesSuite.categoryStats (adrBlog) bundle // initialize Sources data if not defined (frequenciesData.sourcesHtml) new (stringType, @frequenciesData.sourcesHtml) frequenciesData.sourcesHtml = "" if frequenciesData.sourcesHtml == "" frequenciesSuite.sourceStats (adrBlog) return (true) bundle // test code startup () /{Geneva 6 Fd&?%LANDmac This script returns a string which appears in the Status Center on the Radio UserLand home page. on statusCenterMessage (adrBlog=radio.weblog.init ()) return ("You have posted " + sizeOf (adrBlog^.posts) + " items, including " + frequenciesData.postCount + " from " + frequenciesData.sourceCount + " sources.") *Geneva :P@> &?{LANDmac on updateData (adrBlog=radio.weblog.init ()) if (frequenciesSuite.categoryStats (adrBlog) != "") && (frequenciesSuite.sourceStats (adrBlog) != "") return (true) else return (false) bundle // test code updateData () 6 B  !- ?K Ye |  ( background callbackscategoriesMessage, categoryStatsflFrequenciesDataStalegetCategoryStatsPgetSourceStatsmenu" sourceStats#Vstartup4RstatusCenterMessage: updateData<NGeneva 6 B(&?@LANDmac This script runs in its own thread. loop //loop until the application quits bundle //initialize if not defined (system.temp.frequencies) new (tableType, @system.temp.frequencies) if not defined (system.temp.frequencies.started) system.temp.frequencies.started = frequenciesSuite.startup () if not defined (system.temp.frequencies.thread) new (tableType, @system.temp.frequencies.thread) if not defined (system.temp.frequencies.thread.runs) system.temp.frequencies.thread.runs = 0 if not defined (system.temp.frequencies.thread.first) system.temp.frequencies.thread.first = clock.now() if not defined (system.temp.frequencies.thread.last) system.temp.frequencies.thread.last = clock.now() bundle // check for Categories Modification if defined (frequenciesData.categoriesModified) local (adrBlog = radio.weblog.init ()) if (timeModified (@adrBlog^.categories) != frequenciesData.categoriesModified) frequenciesData.stale = true else frequenciesData.stale = true bundle // check for Stale Frequencies Data if defined (frequenciesData.stale) if frequenciesData.stale if frequenciesSuite.updateData () frequenciesData.stale = false bundle // update Extraneous Thread Stats system.temp.frequencies.thread.runs++ system.temp.frequencies.thread.last = clock.now() bundle // make sure that we're still supposed to be running... if not user.tools.databases.frequencies.flEnabled break thread.sleepFor (10) bundle // cleanup delete (@system.temp.frequencies.started) NTP.6 6  ctenabledscript?TtArial FF2LANDmac on finalFilter (pta) pta^.renderedText = string.replace (pta^.renderedText, "[[title]]", "") return (true) ����������������������������� ���-����Geneva���������������������������� ��������������Eu`Q�������2LAND������mac ������������on firstFilter (adrPageTable) return (true) �����������������������*��[����Geneva���������������������������� ��������������Eu7a���o���L�3*lLAND������mac ������������on pageFilter (pta) if typeOf (pta^.template) == outlineType or typeOf (pta^.template) == wpTextType table.assign (@pta^.template, string (pta^.template)) if typeOf (pta^.template) == stringType and not pta^.indirectTemplate pta^.template = string.replace (pta^.template, "<title>", "[[title]]") html.addPageToGlossary (pta) return (true) �����������������������������������������������y���.���EF�������� ���� ��� ����$���0 ����; finalFilter������G firstFilter������H pagefilter������I{��VGeneva���������������������������� �����������P�E��$����������������������������G�������C������76 �������� ����url���http://127.0.0.1/frequencies/���G���j�������f���$���;=S;=S�������� ���� ���! ����&linetext���Category Frequenciespath���categories/index.wsf���j���V�������R���$���;=M;=M�������� ���� ��� ����linetext��� Frequenciespath��� index.wsf���V���e�������a���$���;=;=�������� ���� ��� ����$linetext���Source Frequenciespath���sources/index.wsf���e�������������.�������;=�������� �������! ����-���9 ����LCategory Frequencies������L Frequencies������M,Source Frequencies������M��VArial����������������������������� ����������������������������������������������������������W����������������������space���/GIFfGIF89a�������!����,�������D�;��VArial����������������������������� ����������������������������������������������������������������Geneva���������������������������� ��������������@۸@w�����&�LAND������mac ������������<navigator> <item name="Frequencies" pagename="/frequencies/" title="Radio Frequencies"/> <item name="Categories" pagename="/frequencies/categories/" title="Category Frequencies"/> <item name="Sources" pagename="/frequencies/sources/" title="News Source Frequencies"/> </navigator> �����������������������������g������ ���j�������I�������� ������� �������"�������+ ����0���: ����M���S ����h���n ����w��� ������� ����alink���008000bgcolor���FFFFFFflRenderlink���0000FFmacroEndCharacters���%>macroStartCharacters���<%spaceGif���spacetext���000000vlink���800080��VArial����������������������������� �����������������������������������������������g�����������*���W����Geneva���������������������������� ��������������@@ �����&?LAND������mac ������������<!-- Begin subTemplate --> <%navigatorLinks%> <%bodyText%> <!-- End subTemplate --> �����������������������������������������n�����������������Bs������VArial����������������������������� ������������������������������������������������n������FFFF000000060001001777AA00000000006500000000100171-7EFB6FBE18000004800480672200-1020672222FFFF010315C000010000003700000001015D4084067222215D028E000666726000020000016300000000�15D,#title "Category Frequencies Help" <a href="../">Frequencies</a> | <a href="../categories/">Categories</a> | <a href="../sources/">Sources</a><p> Category frequencies are gathered by looping over your categories. If you've enabled HTML rendering for a category, then the category's name will be linked the the HTML rendering. 00040000000A00000002015F0000500000014000000040A71A8015F0000600000031000000010A20FFFF0900000 20 00070000002F000000020301801017000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 10000900000015000000023E61E53E61E5000A0000001500000002672222672222000B00000005000000020000C000000140000000115CA84A670000F0000005200000000400 10 �4,��4,��4,��4,��4,��4,��4,�00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�<{F[r�����������������������������������������]����������28+0������s��������������������������������������������������������5����FFFF000000060001001777AA00000000006A00000000100171-7EFF6FBE180000048004806DE200-19FA19FA106DE222FFFF010328000010000003500000001028A8406DE22228A028E000D26DE6000020000029000000000�28A,#title "Category Frequencies" <a href="../">Frequencies</a> | <b>Categories</b> | <a href="../sources/">Sources</a><p> This table shows all of your categories. They are sorted by the number of items posted. <a href="help"><%radio.macros.imageRef ("/system/images/icons/help.gif")%></a><p> <%frequenciesSuite.getCategoryStats ()%> <script language="JavaScript" type="JavaScript"> <!-- Hide script from old browsers if (document.referrer != "") { document.write ("<p>Click <a href=\"" + document.referrer + "\">here</a> to return to the page that led you here.<p>") } // End hiding script from old broswers --> </script> 00040000000A00000002028C00005000000200000000608C18D0137128A028C0000600000031000000010A20FFFF0900000 20 00070000002F000000020401802017000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 1000090000001700000002314625D314625D000A00000015000000026DE2226DE222000B00000005000000020000C000000140000000128233222B0000F0000005200000000400 10 �4, </o�4,ine �4,ov 2�4,3 GM�4,henC�4,, 21�4,13.h00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�)!B���1������������������������������������������������28������������������������������������������������������������5���O�������K���$���)<{�������� ������� ����help������T^index������Za���O��L����FFFF000000060001001777AA00000000006000000000100171-7EFB6FBE180000048004806126200-106126222FFFF01035000001000000380000000102AE84061262222AE028E00011A6126600002000002B400000000�2AE,#title "Frequencies" Tools to measure Radio UserLand frequencies.<p> Frequency data is updated each time you upstream or delete a file or modify a category. <ul> <li> <a href="categories/" title="Categories">Categories</a>: <%frequenciesSuite.categoriesMessage ()%> </li> <li> <a href="sources/" title="Sources">Sources</a>: <%frequenciesSuite.statusCenterMessage ()%> </li> </ul> <script language="JavaScript" type="JavaScript"> <!-- Hide script from old browsers if (document.referrer != "") { document.write ("<p>Click <a href=\"" + document.referrer + "\">here</a> to return to the page that led you here.<p>") } // End hiding script from old broswers --> </script> 00040000000A0000000202B000005000000150000000401612AE02B00000600000031000000010A20FFFF0900000 20 00070000002F000000020301801017000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 100009000000170000000231542253154225000A000000170000000261262226126222000B00000005000000020000C0000001700000001508F3714F42E0000F0000005200000000400 10 �4, </o�4,ine �4,ov 2�4,3 GM�4,henC�4,, 21�4,13.h00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�)!F[���������������������������������������������������28p������������������������������������������������������������L������FFFF000000060001001777AA00000000006600000000100171-7FFF6FBE1800000480048064E200-17F7F064E222FFFF0103A00000100000037000000010EF4084064E222A6028E0004264E15200002000000F400000000�EF,#title "Source Frequencies Help" <a href="../">Frequencies</a> | <a href="../categories/">Categories</a> | <a href="../sources/">Sources</a><p> Source frequencies are gathered by looping over all of your weblog posts.000400000009000000020F10000500000013000000040A51A60F10000600000031000000010A20FFFF0900000 20 00070000002F000000020301801017000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 100009000000150000000239C17D39C17D000A000000150000000264E22264E222000B00000005000000020000C0000001600000001A09F31913910000F0000005200000000400 10 �4,Radi�4,ee, �4, *�4,Radi�4,6����4,ee, �4, +00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�<{F[����������������������������������������������������28��������������������������������������������������������������J����FFFF000000060001001777AA00000000005E00000000100171-7EFB6FBE180000048004806EA200-106EA222FFFF01032600001000000350000000102AB8406EA2222AB028E000DE6EA600002000002B100000000�2AB,#title "Source Frequencies" <a href="../">Frequencies</a> | <a href="../categories/">Categories</a> | <b>Sources</b><p> This table shows all of the news sources from which you have posted items. They are sorted by the number of items posted. <a href="help"><%radio.macros.imageRef ("/system/images/icons/help.gif")%></a><p> <%frequenciesSuite.getSourceStats ()%> <script language="JavaScript" type="JavaScript"> <!-- Hide script from old browsers if (document.referrer != "") { document.write ("<p>Click <a href=\"" + document.referrer + "\">here</a> to return to the page that led you here.<p>") } // End hiding script from old broswers --> </script> 00040000000A0000000202AD00005000000200000000608D18E015A12AB02AD0000600000031000000010A20FFFF0900000 20 00070000002F000000020401802017000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 100009000000170000000231112E631112E6000A00000015000000026EA2226EA222000B00000005000000020000C000000140000000126233222B0000F0000005200000000400 10 �4, </o�4,ine �4,ov 2�4,3 GM�4,henC�4,, 21�4,13.h00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�)!FZ���4������������������������������������������������6�Z������������������������������������������������������������J���O�������K���$���)<�������� ������� ����help������iUindex������n���O��������n���~���7Bp�������� ���� ��� �������* ����4���@ ����H���T ����d���p ����w��� ������� ������� ������� ������� ����#filters������K#ftpSite������Lc #glossary������M#images������N#navigatorLinks�������O#prefs������Ql #subTemplate�������R#tools������S categories������aindex������asources������v@��VVerdana��������������������������� ������������??8��������������������������E����������L���EuָI��������������� �������% ����5���A ����R���^ ����p���| ����#enabledfrequenciesData�������XfrequenciesInfo�������frequenciesSuite������>*frequenciesThread������GTfrequenciesWebsite������v��VGeneva���������������������������� ����������o�`w������������������������E���������xo?8Chicago��������������������������?� ����������������Charcoal�������������������������� �����������������A��Geneva����������������������������� ����������������]=Chicago��������������������������?� ����������������l.Chicago��������������������������?� ����������������Charcoal�������������������������� ��������������������������������������������������������������������������������