diff --git a/README.md b/README.md index 7ace2b9..737cbe0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,22 @@ # simple-chat-graph -Something to see the people you speak with colors and visual stuff +Small web application to display a graph with the message intensity of telegram chats. +![](https://github.com/egeres/asiic/blob/master/simple-chat-graph/screenshot_0.png) -https://github.com/vysheng/tg/blob/master/README-Cygwin.md is needed +## How to use : -or https://github.com/pigpagnet/save-telegram-chat-history +### Step 0 : Export your Telegram chats to a JSON file. +Install the Telegram desktop app. Navigate to Settings > Advanced, then click "Export Telegram data". Disable all the options except for "Personal chats". At the bottom, select "Machine-readable JSON". You can change the download path to set the destination folder of the exported information. Whe you are ready, click "EXPORT" at the bottom. The process might take a few minutes to complete. Once it has finished, you will see a folder named "DataExport_" in the selected directory. + +### Step 1 : Generate your chat files +You must have Python installed to complete the next step (any version greater than 2.7). Execute the generator_files.py script as shown : + +``` +cd repository_directory/test_multifiles +python generator_files.py ..DataExport_/result.json repository_directory/test_multifiles/files +``` + +This will generate a list of .json files at repository_directory/test_multifiles/files. + +### Step 2 : Update the test_multifiles.html file. +Change the value of the variable filenames by the output of the python script : list_of_exported_files = [...] diff --git a/js/graph.js b/js/graph.js index 40e0e69..db0abdd 100644 --- a/js/graph.js +++ b/js/graph.js @@ -49,7 +49,7 @@ var response = $.getJSON( "data_1.json", function(obtained_data) { .always(function() { console.log( "complete" ); }); -console.log(data); +// console.log(data); function getBaseLog(x, y) { return Math.log(y) / Math.log(x); diff --git a/new_index.html b/new_index.html deleted file mode 100644 index 8f44d34..0000000 --- a/new_index.html +++ /dev/null @@ -1,86 +0,0 @@ - -
- - - Chats - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - diff --git a/css/style.css b/old files/css/style.css similarity index 100% rename from css/style.css rename to old files/css/style.css diff --git a/data.csv b/old files/data.csv similarity index 100% rename from data.csv rename to old files/data.csv diff --git a/data.json b/old files/data.json similarity index 100% rename from data.json rename to old files/data.json diff --git a/data_0.json b/old files/data_0.json similarity index 100% rename from data_0.json rename to old files/data_0.json diff --git a/data_1.json b/old files/data_1.json similarity index 100% rename from data_1.json rename to old files/data_1.json diff --git a/data_generator.py b/old files/data_generator.py similarity index 100% rename from data_generator.py rename to old files/data_generator.py diff --git a/data_old.csv b/old files/data_old.csv similarity index 100% rename from data_old.csv rename to old files/data_old.csv diff --git a/date.py b/old files/date.py similarity index 100% rename from date.py rename to old files/date.py diff --git a/generator.py b/old files/generator.py similarity index 100% rename from generator.py rename to old files/generator.py diff --git a/index.html b/old files/index.html similarity index 100% rename from index.html rename to old files/index.html diff --git a/old files/new_index.html b/old files/new_index.html new file mode 100644 index 0000000..61dd658 --- /dev/null +++ b/old files/new_index.html @@ -0,0 +1,16 @@ + + +
+ + Chats + + + + + +
+ +
+ + + diff --git a/others/screenshot_0.png b/others/screenshot_0.png new file mode 100644 index 0000000..2c9de32 Binary files /dev/null and b/others/screenshot_0.png differ diff --git a/test_multifiles/generator_files.py b/test_multifiles/generator_files.py index e1f1d9a..a5c8ec2 100644 --- a/test_multifiles/generator_files.py +++ b/test_multifiles/generator_files.py @@ -134,7 +134,7 @@ else: print "it's empthy..." -print ("list_of_exported_files = " + str(list_of_exported_files)) +print ("\nlist_of_exported_files = " + str(list_of_exported_files)) # with open(working_directory+'\\files\\data_1.json', 'w') as outfile: