📜 ⬆️ ⬇️

Download GTalk's message history to your computer.

Gtalk
I have been using gmail's jabber for communication for a long time. I connected the transport and enjoyed, enjoying life. After half a year, Chingachguk noticed that there was no single wall in his cell, I noticed that it was terribly inconvenient to use history and decided to download the entire history of messages for offline use.

Consider options


Google gears


The first option that Google itself offers is to use Google Gears. But in order to view the story, you still need to go to the browser, and this is more than inconvenient (at least for me), it is much more pleasant for me to store history in text form.
Also, it is not safe to keep message history online. Let it be stored on Google's server, even if everything is logged on AOL servers, but I do not want it to be accessible from my gmail account. At least long-term - let the history of a week ago be kept. No more.

Store in native form on your computer


This is not possible by standard methods. The story is not downloaded from POP3, IMAP, it is missing in the GTalk client. No button "Download story" even close and no.
Well. Do not want in a good way, we will in a bad way.

Dances with a tambourine


We keep the pages with the story on your computer.


Training
')
In the "chat rooms" I have about two thousand logs. You need to open each and save.
To do this manually, of course, we will not. To do this, install the iMacros add- on for Firefox.
What do we need to save? Preferably, only the log itself - without any logos, buttons and tabs. Ideally - there is a “print version” in gmail!

Write macro

To begin with, create a new label, for example, “chats”. Go to "Chats" and mark ALL logs with this label. For what? And you will see soon.
Moving to Gmail view: simplified (bottom of page)
What do we see? Tabs "Chats" no! But we are cunning - we select the “chats” label and see all the chats.
We open iMacros and reduce the page size a bit so that the entire panel with the buttons “Remove Label”, “Report Spam”, the numbers on the number of messages were WITHOUT line breaks.
Start recording a macro.
First of all, we change the click mode - to positional - X / Y. Click on the first message - on the label "chats" next to the topic. When it opens, we change the click mode on Auto , right-click on “Print” and select “Save Target As ...” and save to any folder. Then again we change the click mode on X / Y and click on the “Remove shortcut chats” button. Finish the recording.
Now go to Edit.
Remove the third line (URL GOTO = ...) and you get something like this:

VERSION BUILD=6251204 RECORDER=FX
TAB T=1
URL GOTO=http://mail.google.com/mail/h...
CLICK X=442 Y=177
ONDOWNLOAD FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}} WAIT=YES
TAG POS=2 TYPE=A ATTR=TXT: CONTENT=EVENT:SAVETARGETAS
CLICK X=268 Y=151


Save the macro under some name.

Launch

Everything will be saved to the folder that is specified in the iMacros'a options (Download folder). Put a label “chats” on the messages from which it was removed as a result of experiments, go to the download folder and delete all its contents.
Run the macro a hundred times with a break of 10 minutes to avoid blocking the account. During the operation, I was blocked 3 times for one hour :)

Convert to text file


And so ... all the files with the history on our computer. But they are all with a bunch of html tags.
The solution to the problem is the html2text utility - it is in almost all linux repositories, seen on the network and under windows.
$ cd folder_zakachek_iMacros
$ html2text *> ~ / all.txt
After this command, the entire history will be saved to the text file all.txt in the home folder in a rather convenient way.

Congratulations! We did it! Now you can, with a clear conscience, delete the history from gmail.
Thanks for attention.

Taking this opportunity, I express my gratitude to levsha100 for an invite;)

Source: https://habr.com/ru/post/78742/


All Articles