Extracting details in Messenger or Facebook

Hi Cedric,
Is there a way of grabbing firstname, email address, phone number etc from messenger like can be done with the Gmail & LinkedIn command pack?
I build chatbots and it is easy to insert those fields into messenger and Facebook.
I've read through the Community Q&A on Blaze.today but there doesn't seem to be any mention of anything relating to Messenger or Facebook.
I will create the syntax / text that I want to use, but if you could write the snippet just for extracting the person's first name, email address and phone number on messenger that would be fantastic
Best regards,
Tez Molloy

Hi @Dr_Tez_Molloy - welcome to the forum and thanks for the interesting question.

The way to do this would be to use the {site} command together with the selector setting to catch the information loaded on the page.

Here's what that would look like for the profile name on messenger:

{site: text; selector=div.d2edcug0.j83agx80.bp9cbjyn.aahdfvyu.bi6gxh9e}

Since you build chatbots I'm guessing you already know how to discover selectors for various data presented in the DOM, so I won't go into it here. But if you need help with that, let me know and I'll explain further.

With regards to the other data (email and phone), I doubt you would be able to extract that. The {site} command only allows you to extract data that is visible in the DOM. That said, if you can find a page where that information is listed, you should be able to exctract it using the method I illustrated above.

Thank you Cedric. it seems that I have a very basic understanding of bots so could you please explain how to discover selectors for various data presented in the DOM, and what is the DOM?

@Dr_Tez_Molloy - sorry for making the assumption. Let me explain.

DOM stands for Document Object Model, in simple terms, the model of the page.

To find a selector, right click on the piece of data you want to capture. In the context menu, click "inspect". This will open up the browser console and you should see a bunch of code.

The highlight should be on the line of code representing the data you chose. You'll notice that if you mouse over the various lines of code, it will highlight different areas on the page.

Go to the line of code you need. Click on the three dots to the left, then click "copy > selector". This will copy the selector in question to your computer clipboard.

Then all you need to do is insert that selector in the Text Blaze command:

{site:text; selector=}

(without the angled brackets).

Try it out and let me know how it goes.

I would be nice to get also FB/INSTAGRAM Command Pack.

We're definitely exploring additional command packs in the future. If you have any additional ideas (including these) please post them in the "Feature Ideas" forum so we can track them :slight_smile: