diff --git a/bin/Curve.py b/bin/Curve.py index 61afc81a..e6c0bb05 100755 --- a/bin/Curve.py +++ b/bin/Curve.py @@ -120,14 +120,14 @@ if __name__ == "__main__": #consider the num of occurence of this term curr_word_value = int(server_term.hincrby(timestamp, low_word, int(score))) #1 term per paste - curr_word_value_perPaste = int(server_term.hincrby(timestamp, low_word, int(1))) + curr_word_value_perPaste = int(server_term.hincrby("per_paste_" + str(timestamp), low_word, int(1))) # Add in set only if term is not in the blacklist if low_word not in server_term.smembers(BlackListTermsSet_Name): #consider the num of occurence of this term server_term.zincrby(curr_set, low_word, float(score)) #1 term per paste - server_term.zincrby("per_paste_" + curr_set, low_word, float(score)) + server_term.zincrby("per_paste_" + curr_set, low_word, float(1)) #Add more info for tracked terms check_if_tracked_term(low_word, filename) diff --git a/bin/CurveManageTopSets.py b/bin/CurveManageTopSets.py index 8fd5b9bf..562705cf 100755 --- a/bin/CurveManageTopSets.py +++ b/bin/CurveManageTopSets.py @@ -63,7 +63,7 @@ def manage_top_set(): else: dico[word] = value - for word, value in "per_paste_" + array_top_day: + for word, value in array_top_day_per_paste: if word not in server_term.smembers(BlackListTermsSet_Name): if word in dico_per_paste.keys(): dico_per_paste[word] += value diff --git a/var/www/Flasks/Flask_terms.py b/var/www/Flasks/Flask_terms.py index 3ccf525d..b56375e7 100644 --- a/var/www/Flasks/Flask_terms.py +++ b/var/www/Flasks/Flask_terms.py @@ -208,16 +208,21 @@ def terms_plot_top_data(): today = today.replace(hour=0, minute=0, second=0, microsecond=0) today_timestamp = calendar.timegm(today.timetuple()) - set_day = "TopTermFreq_set_day_" + str(today_timestamp) - set_week = "TopTermFreq_set_week"; - set_month = "TopTermFreq_set_month"; - - the_set = request.args.get('set') - num_day = int(request.args.get('num_day')) per_paste = int(request.args.get('per_paste')) if per_paste == 1: - the_set = "per_paste_" + the_set + per_paste = "per_paste_" + else: + per_paste = "" + set_day = per_paste + "TopTermFreq_set_day_" + str(today_timestamp) + set_week = per_paste + "TopTermFreq_set_week"; + set_month = per_paste + "TopTermFreq_set_month"; + + the_set = per_paste + request.args.get('set') + num_day = int(request.args.get('num_day')) + + print(set_day) + print(per_paste) if the_set is None: return "None" else: @@ -235,7 +240,7 @@ def terms_plot_top_data(): position['month'] = position['month']+1 if position['month'] is not None else "<20" value_range = [] for timestamp in range(today_timestamp, today_timestamp - num_day*oneDay, -oneDay): - value = r_serv_term.hget(timestamp, term) + value = r_serv_term.hget(per_paste+str(timestamp), term) curr_value_range = int(value) if value is not None else 0 value_range.append([timestamp, curr_value_range]) diff --git a/var/www/templates/terms_management.html b/var/www/templates/terms_management.html index 3d4f2f77..1cbfb67c 100644 --- a/var/www/templates/terms_management.html +++ b/var/www/templates/terms_management.html @@ -116,21 +116,19 @@
- {% set i = 0 %} {% for term in track_list %}
Termx | +Term | Added date | Action | |
---|---|---|---|---|
{{ black_list[i][0] }} | -{{ black_list[i][1] }} | +{{ term }} | +{{ date }} | - + |