Skip to content

Commit

Permalink
Sleep to make sure post data is there/updated
Browse files Browse the repository at this point in the history
Also remove duplicate import
  • Loading branch information
csnardi committed Jan 23, 2015
1 parent e3a56ba commit f6c9c23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bodyfetcher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from spamhandling import *
from chatcommunicate import *
from datahandling import *
from spamhandling import handle_spam

class BodyFetcher:
queue = {}
Expand Down Expand Up @@ -46,6 +45,8 @@ def print_queue(self):
def make_api_call_for_site(self, site):
posts = self.queue.pop(site)
url = "http://api.stackexchange.com/2.2/questions/" + ";".join(str(x) for x in posts) + "?site=" + site + "&filter=!4y_-sca-)pfAwlmP_1FxC6e5yzutRIcQvonAiP&key=IAkbitmze4B8KpacUfLqkw(("
# wait to make sure API has/updates post data
time.sleep(30)
response = requests.get(url).json()

GlobalVars.apiquota = response["quota_remaining"]
Expand Down

0 comments on commit f6c9c23

Please sign in to comment.