Skip to content

Instantly share code, notes, and snippets.

@duk3luk3
Created January 3, 2014 01:39
Show Gist options
  • Save duk3luk3/8231009 to your computer and use it in GitHub Desktop.
Save duk3luk3/8231009 to your computer and use it in GitHub Desktop.
import requests
import time
import re
while True:
t = time.asctime()
r = requests.get('http://digitalocean.com')
lines = r.text.split("\n")
nums = []
for l in lines:
m = re.search(r"(?<=count'>)\d",l)
if m:
nums.append(m.group(0))
if (len(nums)>0):
n = 0
for i in range(len(nums)):
m = len(nums)-i-1
n = n + int(nums[i])*10**m
print(t)
print(n)
time.sleep(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment