|
@@ -0,0 +1,26 @@
|
|
|
+#! /usr/bin/env python
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
+# vim:fenc=utf-8
|
|
|
+
|
|
|
+"""
|
|
|
+用户画像信息提取在不断迭代中,可能需清除旧的用户画像信息避免干扰,故提供此工具
|
|
|
+"""
|
|
|
+import sys
|
|
|
+import os
|
|
|
+sys.path.append(os.curdir)
|
|
|
+import configs
|
|
|
+from user_manager import MySQLUserManager
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ config = configs.get()
|
|
|
+ user_db_config = config['storage']['user']
|
|
|
+ staff_db_config = config['storage']['staff']
|
|
|
+ user_manager = MySQLUserManager(user_db_config['mysql'], user_db_config['table'], staff_db_config['table'])
|
|
|
+
|
|
|
+ user_ids_to_clean = ['7881299986081786', '7881303544096524', '7881300732152777', '7881301752098239', '7881299457990953', '7881302872936170',]
|
|
|
+ for user_id in user_ids_to_clean:
|
|
|
+ profile = user_manager.get_user_profile(user_id)
|
|
|
+ profile['name'] = ''
|
|
|
+ profile['preferred_nickname'] = ''
|
|
|
+ user_manager.save_user_profile(user_id, profile)
|
|
|
+
|