Commit c99dc50c344eee79e991ed43e7e363f65510721e

Authored by Noah ago
1 parent 26e7f58a65
Exists in master

getContextType 빼먹음 ㅈㅅㅈㅅ

Showing 3 changed files with 8 additions and 5 deletions Side-by-side Diff

insight/context.py View file @ c99dc50
... ... @@ -26,7 +26,7 @@
26 26  
27 27  
28 28 def __init__(self, token):
29   - print "context"
  29 + #print "context"
30 30 self.token = token.getToken()
31 31  
32 32 def setOrderList(self, list):
... ... @@ -56,7 +56,7 @@
56 56 time_now = int(time.time())
57 57  
58 58 return_val = []
59   - for list in self.orderlist:
  59 + for list in self.orderlist[:1]:
60 60 time.sleep(1)
61 61 url = 'https://graph.facebook.com/v2.5/%d/feed?'%list
62 62 txt = requests.get(url + self.token).text
insight/insight.py View file @ c99dc50
... ... @@ -12,7 +12,7 @@
12 12  
13 13 def __init__(self,token):
14 14 self.token = token.getToken()
15   - print "Insight"
  15 + #print "Insight"
16 16  
17 17 def setContentInsight(self,content_id):
18 18  
... ... @@ -54,6 +54,6 @@
54 54 self.type = data['type']
55 55 #print self.type
56 56  
57   - def getContentType(self, data):
  57 + def getContentType(self):
58 58 return self.type
... ... @@ -22,6 +22,7 @@
22 22  
23 23 for content in contents_list:
24 24 datadb = DataDB()
  25 + #print content
25 26 time.sleep(1)
26 27 #print content['id'].split('_')
27 28 p_id = str(content['id'].split('_')[0])
28 29  
... ... @@ -81,12 +82,14 @@
81 82  
82 83 sqlprefix += "`p_id`, "
83 84 sqlprefix += "`c_id`, "
  85 + sqlprefix += "`type`, "
84 86 sqlprefix += "`message`, "
85 87 sqlprefix += "`created_time`, "
86 88 sqlprefix += "`loging_time`, "
87 89  
88 90 sqlvalues += p_id + ", "
89 91 sqlvalues += c_id + ", "
  92 + sqlvalues += "'" + insight.getContentType() + "', "
90 93 sqlvalues += "'" + message + "', "
91 94 sqlvalues += "'" + created_time + "', "
92 95 sqlvalues += "NOW(), "
... ... @@ -101,7 +104,7 @@
101 104 sqlprefix = sqlprefix[:len(sqlprefix)-2] + ")"
102 105 sqlvalues = sqlvalues[:len(sqlvalues)-2] + ");"
103 106  
104   -
  107 + #print sqlprefix + sqlvalues
105 108 datadb.fb_insert(sqlprefix + sqlvalues)
106 109 #print sqlprefix + sqlvalues
107 110