diff --git a/var/www/modules/hiddenServices/Flask_hiddenServices.py b/var/www/modules/hiddenServices/Flask_hiddenServices.py index d61466ef..3153f2a9 100644 --- a/var/www/modules/hiddenServices/Flask_hiddenServices.py +++ b/var/www/modules/hiddenServices/Flask_hiddenServices.py @@ -80,7 +80,7 @@ def hiddenServices_page_test(): return render_template("Crawler_index.html") @hiddenServices.route("/crawlers/crawler_splash_onion", methods=['GET']) -def hiddenServices_page(): +def hiddenServices_page_l(): last_onions = r_serv_onion.lrange('last_onion', 0 ,-1) list_onion = [] @@ -389,5 +389,23 @@ def domain_crawled_7days_json(): return jsonify(json_domain_stats) +@hiddenServices.route('/hiddenServices/automatic_onion_crawler_json') +def automatic_onion_crawler_json(): + current_date = request.args.get('date') + type = 'onion' + + num_day_type = 7 + date_range = get_date_range(num_day_type) + range_decoder = [] + for date in date_range: + day_crawled = {} + day_crawled['date']= date[0:4] + '-' + date[4:6] + '-' + date[6:8] + day_crawled['UP']= nb_domain_up = r_serv_onion.scard('{}_up:{}'.format(type, date)) + day_crawled['DOWN']= nb_domain_up = r_serv_onion.scard('{}_up:{}'.format(type, date)) + range_decoder.append(day_crawled) + + return jsonify(range_decoder) + + # ========= REGISTRATION ========= app.register_blueprint(hiddenServices, url_prefix=baseUrl) diff --git a/var/www/modules/hiddenServices/templates/Crawler_Splash_onion.html b/var/www/modules/hiddenServices/templates/Crawler_Splash_onion.html index 4ae0b358..3518e455 100644 --- a/var/www/modules/hiddenServices/templates/Crawler_Splash_onion.html +++ b/var/www/modules/hiddenServices/templates/Crawler_Splash_onion.html @@ -7,34 +7,38 @@ + + @@ -46,7 +50,7 @@
- -------------- +++ ++ +
++ + + + {% for metadata_onion in last_onions %} +Domain +First Seen +Last Check +Status ++ + {% endfor %} + +{{ metadata_onion['domain'] }} +{{'{}/{}/{}'.format(metadata_onion['first_seen'][0:4], metadata_onion['first_seen'][4:6], metadata_onion['first_seen'][6:8])}} +{{'{}/{}/{}'.format(metadata_onion['last_check'][0:4], metadata_onion['last_check'][4:6], metadata_onion['last_check'][6:8])}} ++ + + {{metadata_onion['status_text']}} ++
Some quick example text to build on the card title and make up the bulk of the card's content.
+