Advertisement
jackieradallhazik

Time in the world

Dec 30th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from urllib import urlopen
  2. parse = 'div id=i_time'
  3. link = 'https://www.timeanddate.com/worldclock/fullscreen.html?n='
  4. def get(link,parse):
  5.     a = urlopen(link)
  6.     b = a.read()
  7.     local = b.find(parse)
  8.     if local == -1:
  9.         return 'false'
  10.     else:
  11.         local += len(parse)+1
  12.     lo = local
  13.     string = ''
  14.     while True:
  15.         if b[lo:lo+1] == '<':
  16.             break
  17.         else:
  18.             string += b[lo:lo+1]
  19.             lo+=1
  20.     return string
  21. print get(link,parse)
  22. for i in range(7000):
  23.     d = link + str(i)
  24.     c = get(d,parse)
  25.     if c == 'false':
  26.         print str(i)+' : <error>'
  27.     else:
  28.         print str(i)+')' + get(d,'div id=rs1><div')
  29.         print '[+] time: ' + c
  30.         print str(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement