grabbing mysms and Messenger conversations with Perl
[Messenger
mysms
Perl
Windows
Vim
WhatsApp
]
mysms
For at least a decade I’ve been using mysms to be able to manage my main smartphone’s text messages from any browser.
On my smartphone, I need to allow mysms - Remote Text Messages as my default text messaging app, which of course I’m okay with. Then, in any browser, I just need to login to app.mysms.com, and then I can see a message stream, like this:
mysms
defaults to Short Message Service (SMS), but if you paste in an image or a pdf to attach, then it switches to Multimedia Messaging Service (MMS).
See that the most recent message is up top, while typically on an Android phone the most recent message is at bottom, above a space to enter your next message.
scrape off past texts
In my browser, I highlight all my messages - here it would be all the text encircled in pink - and Copy
that, then Paste
it into an empty scrape.md
. It looks like this:
Friday, January 13, 2023
Preshila:Hi Joseph, Okay. 11:14 AM
Me:Hello Preshila, could we try this evening? 10:40 AM
Thursday, January 12, 2023
Preshila:I am free only early mornings around 8h-10h or in the evenings when I finish work around 19h30. 5:57 PM
Me:Tomorrow after midday? 5:53 PM
Preshila:Hi Joseph,
Sure, when are you planning to come? 5:40 PM
Me:Hello Preshila, would you have time to help me again with the sink drain ? Joseph 3:14 PM
It’s all there, but not easily readable, and in reverse order. So I decided to write a Perl
script to fix this - mysmsMD.pl - and I call it on scrape.md
in Vim
with keystroke \<f7>
, which gets me this:
- much neater, in descending order with time - like any text document, and also folded up with my simple Vim
folding algorithm.
Facebook Messenger
I then created a similair functionality, MessengerMd.pl for scraping off Messenger texts into a nicely folded up markdown
file.
my helpful Vim configurations for markdown
- markdown.vim - for folding by
markdown
header marks - md.vim - for
\<f7>
Surprisingly straightforward, when you know how - see my $vimfiles/syntax/whatsapp.vim.