[{"data":1,"prerenderedAt":893},["ShallowReactive",2],{"i-lucide:menu":3,"i-lucide:arrow-up-right":8,"i-lucide:moon":10,"i-lucide:sun":12,"i-lucide:rss":14,"i-simple-icons:github":16,"i-simple-icons:linkedin":18,"post-\u002F2013\u002Fpi-hacking-3-etv-viewers-count":21,"surround-\u002F2013\u002Fpi-hacking-3-etv-viewers-count":75,"i-lucide:arrow-left":84,"i-lucide:arrow-right":86,"gist-4698881":88},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 7h10v10M7 17L17 7\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"4\"\u002F>\u003Cpath d=\"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0 1 16 16\"\u002F>\u003Ccircle cx=\"5\" cy=\"19\" r=\"1\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":17},"\u003Cpath fill=\"currentColor\" d=\"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":19,"hidden":20},"\u003Cpath fill=\"currentColor\" d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037c-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85c3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.06 2.06 0 0 1-2.063-2.065a2.064 2.064 0 1 1 2.063 2.065m1.782 13.019H3.555V9h3.564zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0z\"\u002F>",true,{"id":22,"title":23,"body":24,"category":57,"comments":58,"date":59,"description":30,"excerpt":58,"extension":60,"image":58,"meta":61,"navigation":20,"path":62,"readingTime":63,"seo":64,"stem":65,"subtitle":66,"tags":67,"wordCount":73,"__hash__":74},"posts\u002F2013\u002Fpi-hacking-3-etv-viewers-count.md","Pi Hacking #3",{"type":25,"value":26,"toc":53},"minimark",[27,31,42,49],[28,29,30],"p",{},"Just for fun and practice - wouldn't it be cool to have a 4-digit, 7-segment LED display that shows the number of online visitors to... something?",[28,32,33,34,41],{},"A nice candidate for the data provider was ",[35,36,40],"a",{"href":37,"rel":38},"http:\u002F\u002Fetv.err.ee",[39],"nofollow","ETV",", a national public television station that's viewable online. Its web interface refreshes the viewer count via HTTP queries to an internal JS API that suits our needs quite well.",[28,43,44,48],{},[35,45,47],{"href":46},"http:\u002F\u002Flearn.adafruit.com\u002Fadafruit-led-backpack\u002F0-dot-56-seven-segment-backpack","Hooking up the LED display backpack"," was easy. Some quick Python code to do the parsing and display... and we have a nice physical, real-time counter to see how many people are watching the channel at the moment.",[50,51],"gist",{"id":52},"4698881",{"title":54,"searchDepth":55,"depth":55,"links":56},"",2,[],"Hardware",null,"2013-02-02","md",{},"\u002F2013\u002Fpi-hacking-3-etv-viewers-count","less than 1 minute",{"title":23,"description":30},"2013\u002Fpi-hacking-3-etv-viewers-count","ETV Viewers Count",[68,69,70,71,72],"python","api","raspberry pi","err","etv",105,"4Msv9s9yGYk0PlJmg3v6JSOCjPxN2xtg6Ts7IiZlWIc",[76,80],{"title":77,"path":78,"stem":79,"children":-1},"Pi Hacking #2","\u002F2013\u002Fpi-hacking-2-noise-level-monitor","2013\u002Fpi-hacking-2-noise-level-monitor",{"title":81,"path":82,"stem":83,"children":-1},"Self-Lighting LED Lantern","\u002F2013\u002Fself-lighting-led-lantern","2013\u002Fself-lighting-led-lantern",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":85},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":87},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",{"id":89,"title":90,"body":91,"createdAt":884,"description":54,"extension":60,"files":885,"gistId":52,"meta":886,"navigation":20,"owner":887,"path":888,"seo":889,"stem":890,"url":891,"__hash__":892},"gists\u002Fgists\u002F4698881.md","Show the number of online viewers of ETV on a 7-segment display. For Raspberry Pi and Adafruit LED Backpack",{"type":25,"value":92,"toc":882},[93,878],[94,95,99],"pre",{"className":96,"code":97,"filename":98,"language":68,"meta":54,"style":54},"language-python shiki shiki-themes github-light github-dark","#!\u002Fusr\u002Fbin\u002Fpython\n\n# Show the number of viewers of ERR ETV online TV-channel on a 7-segment LCD\n# Built for the Raspberry Pi\n# \n# http:\u002F\u002Fotse.err.ee\u002Fetv\u002F\n# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_LEDBackpack\u002FAdafruit_7Segment.py\n# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_LEDBackpack\u002FAdafruit_LEDBackpack.py\n# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_I2C\u002FAdafruit_I2C.py\n# \n# Author Ando Roots \u003Cando [at] sqroot [dot] eu> 2013\n\nimport time, urllib2\nfrom Adafruit_7Segment import SevenSegment\nimport RPi.GPIO as GPIO\n\nclass ERROnline:\n    \n    # Refresh interval in seconds\n    CHECK_INTERVAL = 10\n    \n    # ERR internal API endpoint, gives JS output\n    API_URL = 'http:\u002F\u002Fotse.err.ee\u002Fxml\u002Flive-etv.html'\n    \n    # 7-segment display (run i2cdetect -y 1 to get the addr)\n    segment = SevenSegment(address=0x70)\n    \n    # Write a 4-digit number to the LCD\n    def write_number(self, value):\n        value = int(value)\n        if value > 9999:\n            print \"Value %s is out of bounds, setting to 9999\" % value\n            value = 9999\n        value = str(value).zfill(4)\n        self.segment.writeDigit(0, int(value[0]))\n        self.segment.writeDigit(1, int(value[1]))\n        self.segment.writeDigit(3, int(value[2]))\n        self.segment.writeDigit(4, int(value[3]))\n        return self\n    \n    # Does an HTTP API query and returns the number of online viewers\n    def get_online_count(self):\n        js_response = urllib2.urlopen(self.API_URL).read()\n        parts = js_response.split(\"$('#viewers').html('\")\n        return parts[1].split(\"');\")[0]\n    \n    # Main loop\n    def run(self):\n        print \"Running the program - press Ctrl + C to exit.\"\n        time.sleep(2)\n        \n        previous_count = 0\n        while True:\n            self.segment.setColon(1)\n            \n            online_count = self.get_online_count()\n            \n            # Change LCD \u002F stdout \n            if online_count != previous_count:\n                check_time = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.gmtime())\n                print \"[%s] ETV Online: %s people watching.\" % (check_time, online_count)\n                self.write_number(online_count)\n                previous_count = online_count\n                \n            self.segment.setColon(0)\n            time.sleep(self.CHECK_INTERVAL)\n            \n    # Cleanup on exit\n    def __del__(self):\n        self.segment.disp.clear()\n        \n# Run the program\nmonitor = ERROnline().run()\n","err.py",[100,101,102,111,116,122,128,134,140,146,152,158,163,169,174,185,199,217,222,235,241,247,259,264,270,282,286,292,317,322,328,340,354,371,392,403,421,447,467,488,507,516,521,527,538,561,577,601,606,612,622,631,641,647,658,669,682,688,702,707,713,728,751,775,784,795,801,812,827,832,838,848,856,861,867],"code",{"__ignoreMap":54},[103,104,107],"span",{"class":105,"line":106},"line",1,[103,108,110],{"class":109},"sJ8bj","#!\u002Fusr\u002Fbin\u002Fpython\n",[103,112,113],{"class":105,"line":55},[103,114,115],{"emptyLinePlaceholder":20},"\n",[103,117,119],{"class":105,"line":118},3,[103,120,121],{"class":109},"# Show the number of viewers of ERR ETV online TV-channel on a 7-segment LCD\n",[103,123,125],{"class":105,"line":124},4,[103,126,127],{"class":109},"# Built for the Raspberry Pi\n",[103,129,131],{"class":105,"line":130},5,[103,132,133],{"class":109},"# \n",[103,135,137],{"class":105,"line":136},6,[103,138,139],{"class":109},"# http:\u002F\u002Fotse.err.ee\u002Fetv\u002F\n",[103,141,143],{"class":105,"line":142},7,[103,144,145],{"class":109},"# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_LEDBackpack\u002FAdafruit_7Segment.py\n",[103,147,149],{"class":105,"line":148},8,[103,150,151],{"class":109},"# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_LEDBackpack\u002FAdafruit_LEDBackpack.py\n",[103,153,155],{"class":105,"line":154},9,[103,156,157],{"class":109},"# https:\u002F\u002Fgithub.com\u002Fadafruit\u002FAdafruit-Raspberry-Pi-Python-Code\u002Fblob\u002Fmaster\u002FAdafruit_I2C\u002FAdafruit_I2C.py\n",[103,159,161],{"class":105,"line":160},10,[103,162,133],{"class":109},[103,164,166],{"class":105,"line":165},11,[103,167,168],{"class":109},"# Author Ando Roots \u003Cando [at] sqroot [dot] eu> 2013\n",[103,170,172],{"class":105,"line":171},12,[103,173,115],{"emptyLinePlaceholder":20},[103,175,177,181],{"class":105,"line":176},13,[103,178,180],{"class":179},"szBVR","import",[103,182,184],{"class":183},"sVt8B"," time, urllib2\n",[103,186,188,191,194,196],{"class":105,"line":187},14,[103,189,190],{"class":179},"from",[103,192,193],{"class":183}," Adafruit_7Segment ",[103,195,180],{"class":179},[103,197,198],{"class":183}," SevenSegment\n",[103,200,202,204,207,211,214],{"class":105,"line":201},15,[103,203,180],{"class":179},[103,205,206],{"class":183}," RPi.",[103,208,210],{"class":209},"sj4cs","GPIO",[103,212,213],{"class":179}," as",[103,215,216],{"class":209}," GPIO\n",[103,218,220],{"class":105,"line":219},16,[103,221,115],{"emptyLinePlaceholder":20},[103,223,225,228,232],{"class":105,"line":224},17,[103,226,227],{"class":179},"class",[103,229,231],{"class":230},"sScJk"," ERROnline",[103,233,234],{"class":183},":\n",[103,236,238],{"class":105,"line":237},18,[103,239,240],{"class":183},"    \n",[103,242,244],{"class":105,"line":243},19,[103,245,246],{"class":109},"    # Refresh interval in seconds\n",[103,248,250,253,256],{"class":105,"line":249},20,[103,251,252],{"class":209},"    CHECK_INTERVAL",[103,254,255],{"class":179}," =",[103,257,258],{"class":209}," 10\n",[103,260,262],{"class":105,"line":261},21,[103,263,240],{"class":183},[103,265,267],{"class":105,"line":266},22,[103,268,269],{"class":109},"    # ERR internal API endpoint, gives JS output\n",[103,271,273,276,278],{"class":105,"line":272},23,[103,274,275],{"class":209},"    API_URL",[103,277,255],{"class":179},[103,279,281],{"class":280},"sZZnC"," 'http:\u002F\u002Fotse.err.ee\u002Fxml\u002Flive-etv.html'\n",[103,283,284],{"class":105,"line":5},[103,285,240],{"class":183},[103,287,289],{"class":105,"line":288},25,[103,290,291],{"class":109},"    # 7-segment display (run i2cdetect -y 1 to get the addr)\n",[103,293,295,298,301,304,308,311,314],{"class":105,"line":294},26,[103,296,297],{"class":183},"    segment ",[103,299,300],{"class":179},"=",[103,302,303],{"class":183}," SevenSegment(",[103,305,307],{"class":306},"s4XuR","address",[103,309,310],{"class":179},"=0x",[103,312,313],{"class":209},"70",[103,315,316],{"class":183},")\n",[103,318,320],{"class":105,"line":319},27,[103,321,240],{"class":183},[103,323,325],{"class":105,"line":324},28,[103,326,327],{"class":109},"    # Write a 4-digit number to the LCD\n",[103,329,331,334,337],{"class":105,"line":330},29,[103,332,333],{"class":179},"    def",[103,335,336],{"class":230}," write_number",[103,338,339],{"class":183},"(self, value):\n",[103,341,343,346,348,351],{"class":105,"line":342},30,[103,344,345],{"class":183},"        value ",[103,347,300],{"class":179},[103,349,350],{"class":209}," int",[103,352,353],{"class":183},"(value)\n",[103,355,357,360,363,366,369],{"class":105,"line":356},31,[103,358,359],{"class":179},"        if",[103,361,362],{"class":183}," value ",[103,364,365],{"class":179},">",[103,367,368],{"class":209}," 9999",[103,370,234],{"class":183},[103,372,374,377,380,383,386,389],{"class":105,"line":373},32,[103,375,376],{"class":209},"            print",[103,378,379],{"class":280}," \"Value ",[103,381,382],{"class":209},"%s",[103,384,385],{"class":280}," is out of bounds, setting to 9999\"",[103,387,388],{"class":179}," %",[103,390,391],{"class":183}," value\n",[103,393,395,398,400],{"class":105,"line":394},33,[103,396,397],{"class":183},"            value ",[103,399,300],{"class":179},[103,401,402],{"class":209}," 9999\n",[103,404,406,408,410,413,416,419],{"class":105,"line":405},34,[103,407,345],{"class":183},[103,409,300],{"class":179},[103,411,412],{"class":209}," str",[103,414,415],{"class":183},"(value).zfill(",[103,417,418],{"class":209},"4",[103,420,316],{"class":183},[103,422,424,427,430,433,436,439,442,444],{"class":105,"line":423},35,[103,425,426],{"class":209},"        self",[103,428,429],{"class":183},".segment.writeDigit(",[103,431,432],{"class":209},"0",[103,434,435],{"class":183},", ",[103,437,438],{"class":209},"int",[103,440,441],{"class":183},"(value[",[103,443,432],{"class":209},[103,445,446],{"class":183},"]))\n",[103,448,450,452,454,457,459,461,463,465],{"class":105,"line":449},36,[103,451,426],{"class":209},[103,453,429],{"class":183},[103,455,456],{"class":209},"1",[103,458,435],{"class":183},[103,460,438],{"class":209},[103,462,441],{"class":183},[103,464,456],{"class":209},[103,466,446],{"class":183},[103,468,470,472,474,477,479,481,483,486],{"class":105,"line":469},37,[103,471,426],{"class":209},[103,473,429],{"class":183},[103,475,476],{"class":209},"3",[103,478,435],{"class":183},[103,480,438],{"class":209},[103,482,441],{"class":183},[103,484,485],{"class":209},"2",[103,487,446],{"class":183},[103,489,491,493,495,497,499,501,503,505],{"class":105,"line":490},38,[103,492,426],{"class":209},[103,494,429],{"class":183},[103,496,418],{"class":209},[103,498,435],{"class":183},[103,500,438],{"class":209},[103,502,441],{"class":183},[103,504,476],{"class":209},[103,506,446],{"class":183},[103,508,510,513],{"class":105,"line":509},39,[103,511,512],{"class":179},"        return",[103,514,515],{"class":209}," self\n",[103,517,519],{"class":105,"line":518},40,[103,520,240],{"class":183},[103,522,524],{"class":105,"line":523},41,[103,525,526],{"class":109},"    # Does an HTTP API query and returns the number of online viewers\n",[103,528,530,532,535],{"class":105,"line":529},42,[103,531,333],{"class":179},[103,533,534],{"class":230}," get_online_count",[103,536,537],{"class":183},"(self):\n",[103,539,541,544,546,549,552,555,558],{"class":105,"line":540},43,[103,542,543],{"class":183},"        js_response ",[103,545,300],{"class":179},[103,547,548],{"class":183}," urllib2.urlopen(",[103,550,551],{"class":209},"self",[103,553,554],{"class":183},".",[103,556,557],{"class":209},"API_URL",[103,559,560],{"class":183},").read()\n",[103,562,564,567,569,572,575],{"class":105,"line":563},44,[103,565,566],{"class":183},"        parts ",[103,568,300],{"class":179},[103,570,571],{"class":183}," js_response.split(",[103,573,574],{"class":280},"\"$('#viewers').html('\"",[103,576,316],{"class":183},[103,578,580,582,585,587,590,593,596,598],{"class":105,"line":579},45,[103,581,512],{"class":179},[103,583,584],{"class":183}," parts[",[103,586,456],{"class":209},[103,588,589],{"class":183},"].split(",[103,591,592],{"class":280},"\"');\"",[103,594,595],{"class":183},")[",[103,597,432],{"class":209},[103,599,600],{"class":183},"]\n",[103,602,604],{"class":105,"line":603},46,[103,605,240],{"class":183},[103,607,609],{"class":105,"line":608},47,[103,610,611],{"class":109},"    # Main loop\n",[103,613,615,617,620],{"class":105,"line":614},48,[103,616,333],{"class":179},[103,618,619],{"class":230}," run",[103,621,537],{"class":183},[103,623,625,628],{"class":105,"line":624},49,[103,626,627],{"class":209},"        print",[103,629,630],{"class":280}," \"Running the program - press Ctrl + C to exit.\"\n",[103,632,634,637,639],{"class":105,"line":633},50,[103,635,636],{"class":183},"        time.sleep(",[103,638,485],{"class":209},[103,640,316],{"class":183},[103,642,644],{"class":105,"line":643},51,[103,645,646],{"class":183},"        \n",[103,648,650,653,655],{"class":105,"line":649},52,[103,651,652],{"class":183},"        previous_count ",[103,654,300],{"class":179},[103,656,657],{"class":209}," 0\n",[103,659,661,664,667],{"class":105,"line":660},53,[103,662,663],{"class":179},"        while",[103,665,666],{"class":209}," True",[103,668,234],{"class":183},[103,670,672,675,678,680],{"class":105,"line":671},54,[103,673,674],{"class":209},"            self",[103,676,677],{"class":183},".segment.setColon(",[103,679,456],{"class":209},[103,681,316],{"class":183},[103,683,685],{"class":105,"line":684},55,[103,686,687],{"class":183},"            \n",[103,689,691,694,696,699],{"class":105,"line":690},56,[103,692,693],{"class":183},"            online_count ",[103,695,300],{"class":179},[103,697,698],{"class":209}," self",[103,700,701],{"class":183},".get_online_count()\n",[103,703,705],{"class":105,"line":704},57,[103,706,687],{"class":183},[103,708,710],{"class":105,"line":709},58,[103,711,712],{"class":109},"            # Change LCD \u002F stdout \n",[103,714,716,719,722,725],{"class":105,"line":715},59,[103,717,718],{"class":179},"            if",[103,720,721],{"class":183}," online_count ",[103,723,724],{"class":179},"!=",[103,726,727],{"class":183}," previous_count:\n",[103,729,731,734,736,739,742,745,748],{"class":105,"line":730},60,[103,732,733],{"class":183},"                check_time ",[103,735,300],{"class":179},[103,737,738],{"class":183}," time.strftime(",[103,740,741],{"class":280},"\"%Y-%m-",[103,743,744],{"class":209},"%d",[103,746,747],{"class":280}," %H:%M:%S\"",[103,749,750],{"class":183},", time.gmtime())\n",[103,752,754,757,760,762,765,767,770,772],{"class":105,"line":753},61,[103,755,756],{"class":209},"                print",[103,758,759],{"class":280}," \"[",[103,761,382],{"class":209},[103,763,764],{"class":280},"] ETV Online: ",[103,766,382],{"class":209},[103,768,769],{"class":280}," people watching.\"",[103,771,388],{"class":179},[103,773,774],{"class":183}," (check_time, online_count)\n",[103,776,778,781],{"class":105,"line":777},62,[103,779,780],{"class":209},"                self",[103,782,783],{"class":183},".write_number(online_count)\n",[103,785,787,790,792],{"class":105,"line":786},63,[103,788,789],{"class":183},"                previous_count ",[103,791,300],{"class":179},[103,793,794],{"class":183}," online_count\n",[103,796,798],{"class":105,"line":797},64,[103,799,800],{"class":183},"                \n",[103,802,804,806,808,810],{"class":105,"line":803},65,[103,805,674],{"class":209},[103,807,677],{"class":183},[103,809,432],{"class":209},[103,811,316],{"class":183},[103,813,815,818,820,822,825],{"class":105,"line":814},66,[103,816,817],{"class":183},"            time.sleep(",[103,819,551],{"class":209},[103,821,554],{"class":183},[103,823,824],{"class":209},"CHECK_INTERVAL",[103,826,316],{"class":183},[103,828,830],{"class":105,"line":829},67,[103,831,687],{"class":183},[103,833,835],{"class":105,"line":834},68,[103,836,837],{"class":109},"    # Cleanup on exit\n",[103,839,841,843,846],{"class":105,"line":840},69,[103,842,333],{"class":179},[103,844,845],{"class":209}," __del__",[103,847,537],{"class":183},[103,849,851,853],{"class":105,"line":850},70,[103,852,426],{"class":209},[103,854,855],{"class":183},".segment.disp.clear()\n",[103,857,859],{"class":105,"line":858},71,[103,860,646],{"class":183},[103,862,864],{"class":105,"line":863},72,[103,865,866],{"class":109},"# Run the program\n",[103,868,870,873,875],{"class":105,"line":869},73,[103,871,872],{"class":183},"monitor ",[103,874,300],{"class":179},[103,876,877],{"class":183}," ERROnline().run()\n",[879,880,881],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":54,"searchDepth":55,"depth":55,"links":883},[],"2013-02-02T19:17:57Z",[98],{},"anroots","\u002Fgists\u002F4698881",{"title":90,"description":54},"gists\u002F4698881","https:\u002F\u002Fgist.github.com\u002Fanroots\u002F4698881","Y-G84nc-PXqPhz0GrVHWmQJ9ATC_Gjm3QuJYZjli0W4",1790886932523]