Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1.  
  2.     for _ in range(random.randint(0, 500)):
  3.         try:
  4.             post = posts.next()
  5.         except StopIteration:
  6.             break
  7.  
  8.         # get timestamp of current post
  9.         if 'created' in post[1]: # see if created is inserted as column, else use WRITETIME of guid as created.
  10.             created = post[1]['created'][0]
  11.         else:
  12.             created = post[1]['data'][1]
  13.         timestamp =  Toolbox.time.usToUtcDatetime(int(created))
  14.         timestamp = timestamp.replace(microsecond=0)
  15.  
  16.         # empty list and start saving new timestamps.
  17.         if (currTimeStamp is None) or (currTimeStamp != timestamp):
  18.             postToCheck = []
  19.             postsToCheck.append(post)
  20.         elif (currTimeStamp == timestamp):
  21.             postToCheck.append(post)   
  22.         else:
  23.             print "this shouldnt happen, help"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement