title: Recheck URL after 5 Min with While Statement True
body: <p>I have a statement that I am using to show data on an LED panel.  After 430 PM it shows time, scrolling text and static text.  The scrolling text is pulled from a form submission and displays on the LED.  What I am trying to accomplish is have the script check every 5 min if an update has happened and then display new text.</p>
  <pre><code> else: 
      def run(self):
          offscreen_canvas = self.matrix.CreateFrameCanvas()
          pos = offscreen_canvas.width
          res = requests.get('https://mysite.io/message/message.php')
          soup = bs(res.content, 'lxml')
          price = soup.select_one('.message').text
          price2 = &quot;Stock Closed&quot;
          font = graphics.Font()
          font.LoadFont(&quot;fonts/5x7.bdf&quot;)
          textColor = graphics.Color(255, 255, 0)
          textColor2 = graphics.Color(255, 0, 255)
          text3 = graphics.Color(255, 0, 0)
          my_text = price
          my_text2 = price2
          
  
          while True:
              offscreen_canvas.Clear()
              my_text1 = &quot;Time: &quot; + strftime(&quot;%H:%M&quot;, localtime())
  
              len1 = graphics.DrawText(offscreen_canvas, font, pos, 7, text3, price) &lt;--- Scrolls
              len2 = graphics.DrawText(offscreen_canvas, font, 1, 19, textColor2, my_text1) &lt;--- Static
              len3 = graphics.DrawText(offscreen_canvas, font, 1, 31, textColor, my_text2)  &lt;--- Static
              pos -= 1
              if (pos + len1 &lt; 0 ):
                  pos = offscreen_canvas.width
              time.sleep(0.07)
              offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)
  </code></pre>
  <p>The above is my current setup.  It only updates once per day.</p>
  <p>I have tried the below.</p>
  <pre><code>        while True:
              offscreen_canvas.Clear()
              my_text1 = &quot;Time: &quot; + strftime(&quot;%H:%M&quot;, localtime())
  
              len1 = graphics.DrawText(offscreen_canvas, font, pos, 7, text3, price)
              len2 = graphics.DrawText(offscreen_canvas, font, 1, 19, textColor2, my_text1)
              len3 = graphics.DrawText(offscreen_canvas, font, 1, 31, textColor, my_text2)
              pos -= 1
              if (pos + len1 &lt; 0 ):
                  pos = offscreen_canvas.width
              time.sleep(0.07)
              offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)
              self.run()
  </code></pre>
  <p>The show the static text but does not scroll the first line.</p>
  <p>I have also tried.</p>
  <pre><code> else: 
  
              offscreen_canvas.Clear()
              offscreen_canvas = self.matrix.CreateFrameCanvas()
              pos = offscreen_canvas.width
              res = requests.get('https://mysite.io/message/message.php')
              soup = bs(res.content, 'lxml')
              price = soup.select_one('.message').text
              price2 = &quot;Stock Closed&quot;
              font = graphics.Font()
              font.LoadFont(&quot;fonts/5x7.bdf&quot;)
              textColor = graphics.Color(255, 255, 0)
              textColor2 = graphics.Color(255, 0, 255)
              text3 = graphics.Color(255, 0, 0)
              my_text = price
              my_text2 = price2
              my_text1 = &quot;Time: &quot; + strftime(&quot;%H:%M&quot;, localtime())
  
              len1 = graphics.DrawText(offscreen_canvas, font, pos, 7, text3, price)
              len2 = graphics.DrawText(offscreen_canvas, font, 1, 19, textColor2, my_text1)
              len3 = graphics.DrawText(offscreen_canvas, font, 1, 31, textColor, my_text2)
              pos -= 1
              if (pos + len1 &lt; 0 ):
                  pos = offscreen_canvas.width
              time.sleep(0.07)
              offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)
  </code></pre>
  <p>The above updates immediately but the scrolling is very very slow.</p>
  <p>So the objective is to have it scroll smooth and update every x minutes.<br />
  Maybe not using beautifulsoup will speed it up so another suggestion would also be welcome.</p>
  <p>Thanks for the help guys.</p>