=qXBq,v 9CSbappPath-C:\Program Files\BitTorrent\btdownloadgui.exe flEnabledhourToStartScanhourToStopScan maxPerDay pp ?;qRTp torrentDownloads? pp so.q,p  $ 1prefsXstatsF torrentQueuesVq,p  $= I  p  author Andrew Grumet authorEmailaegrumet@alum.mit.edu descriptionVAutomates launch of the BitTorrent client for .torrent files downloaded as enclosures. homePageUrl;http://grumet.net/rssBitTorrentIntegration/radioClient.htmlnamebitTorrentIntegration releaseDateversion0.3Arial q,q,LANDwinThis script runs every hour. XT Arial q,qg!sLANDwinThis script runs every minute. Changes 3/7/04; 7:51:52 PM by AG Created. if not tcp.isOffline () if user.bitTorrentIntegration.prefs.flEnabled if not defined (system.temp.radio.misc.flScanningForBitTorrents) system.temp.radio.misc.flScanningForBitTorrents = false if not system.temp.radio.misc.flScanningForBitTorrents local (day, month, year, hour, minute, second) date.get (clock.now (), @day, @month, @year, @hour, @minute, @second) if hour >= user.bitTorrentIntegration.prefs.hourToStartScan if hour < user.bitTorrentIntegration.prefs.hourToStopScan thread.callScript (@bitTorrentIntegrationSuite.downloadTorrents, {}) XArial q,q,LANDwinThis script runs every night. {w.q,q`  ". 9 everyHour everyMinutet everyNight{ q, eTArial qLpn:]LANDwinon downloadEnclosure (adrstory,f) Changes: 3/7/04; 10:25:07 PM by AG Created. This script should be called from user.radio.callbacks.downloadEnclosure. It will run just before each enclosure is downloaded, and queue a BitTorrent download if the enclosure url ends in ".torrent". 5/6/04; 10:44:03 PM by AG Renamed "downloadEnclosure" from "downloadEnclosureCallback" to hook into Frontier's auto-installation code. local (url = string.urldecode (adrstory^.enclosure.url)) if string.hasSuffix(".torrent",url) if not defined (bitTorrentIntegrationData.torrentQueue.[nameOf(adrstory^)]) new (tabletype, @bitTorrentIntegrationData.torrentQueue.[nameOf(adrstory^)]) bitTorrentIntegrationData.torrentQueue.[nameOf(adrstory^)].filepath = f bitTorrentIntegrationData.torrentQueue.[nameOf(adrstory^)].flLaunched = false bundle //test code downloadEnclosure(@aggregatorData.stories.["00074106"],"ignore") e@<q,m downloadEnclosure 3@ q, nj.q,q`  ' ,fileMenu radio user n~Arial =v2?IALANDwinChanges 3/8/04; 9:12:07 AM by AG Cribbed from DW's myWeblogOutliner code. 10/23/02; 4:43:35 PM by DW Created. bitTorrentIntegrationInfo.releaseDate = clock.now () delete(@bitTorrentIntegrationData.stats.torrentDownloads) new (tabletype, @bitTorrentIntegrationData.stats.torrentDownloads) delete(@bitTorrentIntegrationData.torrentQueue) new (tabletype, @bitTorrentIntegrationData.torrentQueue) local (folder = "C:\\Program Files\\Radio UserLand\\www\\userland\\publicTools\\bitTorrentIntegration\\") f = folder + "bitTorrentIntegration.root" file.surefilepath(f) target.set (this) fileMenu.saveCopy (f) radio.thread.wake () dialog.alert (file.filefrompath (f) + " is " + string.megabytestring (file.size (f))) =9q謼q releaseNewCode=Arial q53hLANDwinon downloadTorrents () Changes: 3/7/04; 8:26:54 PM by AG Created. Scans the queue, bitTorrentIntegrationData.torrentQueue looking for not yet downloaded torrents. 3/11/04; 3:15:27 PM by AG Added a check to make sure the enclosure file exists before launching BitTorrent. Pushed the launch call into a bitTorrentIntegrationSuite.os.launchBT, which can be extended to handle OS X. system.temp.radio.misc.flScanningForBitTorrents = true on bmopathFromFilePath(s) return string.delete(s,sizeof(s)-7,infinity) //strip .torrent extension and call that the filename. local (day, month, year, hour, minute, second) date.get (clock.now (), @day, @month, @year, @hour, @minute, @second) local (logtable = string(year) + string.padwithzeros (month, 2) + string.padwithzeros (day, 2)) if not defined (bitTorrentIntegrationData.stats.torrentDownloads.[logtable]) new (tabletype, @bitTorrentIntegrationData.stats.torrentDownloads.[logtable]) local (adrtorrent, adrlogtable = @bitTorrentIntegrationData.stats.torrentDownloads.[logtable]) for adrtorrent in @bitTorrentIntegrationData.torrentQueue if not (adrtorrent^.flLaunched) && (sizeOf(adrlogtable^) < user.bitTorrentIntegration.prefs.maxPerDay) bmopath = bmopathFromFilePath(adrtorrent^.filepath) if file.exists (adrtorrent^.filepath) bitTorrentIntegrationSuite.osspecific.launchBT(adrtorrent^.filepath, bmopath) adrtorrent^.flLaunched = true adrtorrent^.bmopath = bmopath bundle //add it to the table of already-downloaded torrents adrlogtable^.[nameOf(adrtorrent^)] = adrtorrent^ system.temp.radio.misc.flScanningForBitTorrents = false bundle //test code downloadTorrents() [xkArial q2#oA"PLANDwinChanges: 3/7/04; 8:13:20 PM by AG Created. 5/6/04; 10:42:40 PM by AG Removed callback installation code, which was broken and unnecessary. if not defined (user.bitTorrentIntegration) new (tabletype, @user.bitTorrentIntegration) bundle //prefs if not defined (user.bitTorrentIntegration.prefs) new (tabletype, @user.bitTorrentIntegration.prefs) if not defined (user.bitTorrentIntegration.prefs.flEnabled) user.bitTorrentIntegration.prefs.flEnabled = bitTorrentIntegrationData.prefs.flEnabled if not defined (user.bitTorrentIntegration.prefs.appPath) user.bitTorrentIntegration.prefs.appPath = bitTorrentIntegrationData.prefs.appPath if not defined (user.bitTorrentIntegration.prefs.hourToStartScan) user.bitTorrentIntegration.prefs.hourToStartScan = bitTorrentIntegrationData.prefs.hourToStartScan if not defined (user.bitTorrentIntegration.prefs.hourToStopScan) user.bitTorrentIntegration.prefs.hourToStopScan = bitTorrentIntegrationData.prefs.hourToStopScan if not defined (user.bitTorrentIntegration.prefs.maxPerDay) user.bitTorrentIntegration.prefs.maxPerDay = bitTorrentIntegrationData.prefs.maxPerDay [0Arial q,qLANDwinbitTorrentIntegrationSuite.menuCommands.setup() Arial q,qS/LANDwinBitTorrentIntegration Set Up p BVArial 6p |Arial q㭼q^&LANDwinon setup () bitTorrentIntegrationSuite.init() edit(@user.bitTorrentIntegration) window.zoom(@user.bitTorrentIntegration)  40q㦼q setup!4$Arial v/Lv0(i+ALANDwinon launchBT (filepath,bmopath) Changes: 3/11/04; 3:01:46 PM by AG Added Windows support. if (sys.os() == "WinNT") launch.appWithDocument(user.bitTorrentIntegration.prefs.appPath,"\"" + filepath + "\" --saveas \"" + bmopath + "\"") 73v.ov/Z launchBT#*7 }Arial q,q,tLANDwinThis script returns a string which appears in the Status Center on the Radio UserLand home page. return ("I'm a cool Tool!") HDjq,v0n  !- ;G Xd iu z background callbacks codeFreshenergdownloadTorrentsinit}menu!V menuCommands" osspecific$statusCenterMessage%HArial q,q,zLANDwinThis script runs in its own thread. loop //loop until the application quits Add your code here. thread.sleepFor (10) //sleep for ten seconds TP.q,q, ctenabledscript'fTtArial FF2LANDwinon finalFilter (pta) pta^.renderedText = string.replace (pta^.renderedText, "[[title]]", "") return (true) ����������������������������� ���-���� MS Sans Serif��������������������� ��������������Eu`Q�������2LAND�������win������������on firstFilter (adrPageTable) return (true) �����������������������*��[���� MS Sans Serif��������������������� ��������������Eu7a���m���L�3*lLAND�������win������������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�������( firstFilter�������) pagefilter�������*��V MS Sans Serif��������������������� �����������P�E��$����������������������������Q�������M������7q,�������� ����url���'http://127.0.0.1/bitTorrentIntegration/���Q���O�������K���$����������� ���� ��� ����linetext���Homepath��� index.wsf���O����������/������������������ ����Home�������-��VArial����������������������������� ����������������������������������������������������������W����������������������space���/GIFfGIF89a�������!����,�������D�;��VArial����������������������������� ������������������������������������������������������������V��������������� ������� �������"�������+ ����0���: ����C���L ����Q���[ ����aalink���008000bgcolor���FFFFFFflRenderlink���0000FFspaceGif���spacetext���000000vlink���800080��VArial����������������������������� �������������������������������������������������d��������<��������Arial����������������������������� ��������������FF�������LAND�������win������������<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>{title} {metaTags ()} {bodyTag ()} {bodytext} dn8>VArial nFFFF000000060001001777AA00000000005A0000000010017101904900218000006000600329200-1032921FFFFF010E0000100000031000000010E84032921FE048E000163293000020000001200000000E,#title "Home" 000400000009000000020100000500000009000000020100000600000032000000010F310FFFF0C00000 20 000700000019000000010201E00008000000A90000000140,Geneva40,10A0304E44000101000090000001500000002096177096177000A000000150000000232921F32921F000B00000005000000020000C0000001200000001E369AF10000F0000005200000000400 10 4,appn4,send4,84,&4,84,34,800130000007E00000000DA91F8CE1C1D1E1F7F1B044,-..'"FFFF0FFFF0FFFE000000060001001777AAPĵ7}5#``7F  * 4@ HT [g q} #filters,#ftpSite- #glossary.X#images.#prefs/ #template0#tools2Eindex2VVerdana ??8` Bq,o & @L gs bitTorrentIntegrationDatabitTorrentIntegrationInfo<bitTorrentIntegrationSuite&bitTorrentIntegrationThread(bitTorrentIntegrationWebsite7OV]} Arial q,pALANDwinbitTorrentIntegrationData bitTorrentIntegrationInfo bitTorrentIntegrationSuite background callbacks codeFreshener releaseNewCode downloadTorrents init menu menuCommands osspecific statusCenterMessage bitTorrentIntegrationThread bitTorrentIntegrationWebsite (((H((((((8Arial MS Sans Serif  PTimes New Roman! nArial #_Arial MS Sans Serif