Sending Message to FaceBook Friend using Python:

Python consists of many modules, and we will be using one such module in this section. We will be spamming our friends on Facebook. So, let’s start without any more discussion. Though it does not have any direct application in data science but we need to understand it to learn python better.

Send Messages to Facebook Friend using Python for Data Science - PST

Now we will understand the program in a step by step manner.

We need to install the module fbchat and getpass.

Installing fbchat:

If we face an error, we have to check whether development packages of libxml2 and libxslt are installed

Now we will look at how the program works.

Step 1: Getting user credentials.

We can use raw_input() and getpass() for getting the username and the password. We should keep some things in mind.

  1. The Facebook account we are using should have a name.
  2. We will not be using raw_input for getting the password because as soon as the characters are out, we will have a security breach.
Step 2: Entering the name of FB friend.

As we have signed in, now we can send messages to friends and also customize the messages for each one.

Step 3: Spamming

Extensive use of this program can get you banned from Facebook, or your friends can block you. A simple for loop can be used for sending the message again and again.

Note: We can send blank messages on FB by using this function. When the program asks for a message, all we have to do is press enter and continue.

So, to learn more about it in python for data science, you can check this and this as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.