Giter VIP home page Giter VIP logo

fb_er's Introduction

fb_er

A Strong Facebook Scraper and Client

You can use cookies as well as your username and password to login

Login with password is broken , working on fix

2-Factor Authentication is also supported (working on fix)

Example:

Facebook("username/email/phone_number","password")
Facebook(use_cookies=True,cookie="cookie_Value")

Prerequisites

  • Internet Connection
  • Python 3.6+
  • BeautifulSoup (Python Module)
  • Requests (Python Module)
  • magic (Python Module)
  • requests_toolbelt (Python Module)
  • cssutils (Python Module)
  • ics (Python Module)

requirements.txt is also available

All Functions

  • userinfo()
  • get_friends()
  • get_birthdays()
  • get_all_chats()
  • send_message()
  • birthday_to_ics()

Get User Info

Description:

This method can be used to get info of a user

Optional Parameters

  • user : str -> user id of a user if you are trying to get user info of users other than you

Output:

  • Type -> dict
  • Structure
{
     "AccountId": "1000000000000",
     "bio": "Using fb_er.",
     "contact_details": {
           "Email": "",
           "Github": "",
           "Instagram": "",
           "LinkedIn": "",
           "Mobile": "",
           "Skype": "",
           "Snapchat": "",
           "Twitter": "",
           "Website": ""
     },
     "dateOfBirth": "dd mm yyyy",
     "gender": "",
     "joinedOn": "",
     "livesIn": "",
     "name": {
       "alternative_name": "",
       "name": ""
     },
     "total_friends": "161"
}

Example:

from fb_er.client import Facebook

cookies = "cookies_value"
user = Facebook(use_cookies=True, cookie=cookies)
print(user.userinfo())

Get Friends

Description:

This method can be used to get all the friends in a dict

Output:

  • Type -> dict
  • Structure
{
  "friends": [
    {
      "facebook_profile_url": "https://facebook.com//profile",
      "fb_username": "/username_of_friend",
      "name": "name_of_friend",
      "uid": "user_id of friend"
    },
    {}
  ]
}

Example:

from fb_er.client import Facebook

user = Facebook(username="username/email/phone_number", password="password")
print(user.get_friends())

Get Birthdays

Description:

This method can be used to get birthdays on friends in next 12 months

Output:

  • Type -> dict
  • Structure
{
  "birthdays": [
    {
      "Later in Current Month": [
        {
          "birthday": "date_of_birth",
          "name": "friend's name"
        }
      ],
      "Recent Birthdays": [
        {}
      ],
      "Upcoming Birthdays": [
        {}
      ]
    },
    {
      "November": [
        {}
      ]
    },
    {
      "December": [
        {}
      ]
    }
    
  ]
}

Example:

from fb_er.client import Facebook

user = Facebook(username="username/email/phone_number", password="password")
print(user.get_birthdays())

Get Chats

Description:

This method can be used to get last 6 chats in a dict

Output:

  • Type -> dict
  • Structure
{
  "chats": {
    "messages": [
      {
        "inbox": "url_to_direct_inbox_of_that_friend",
        "msg": "last_message_from_that_friend",
        "name": "name_of_sender",
        "timestamp": "last_message_sent_timestamp"
      },
      {}
    ]
  }
}

Example:

from fb_er.client import Facebook

cookies = "cookies_value"
user = Facebook(use_cookies=True, cookie=cookies)
print(user.get_all_chats())

Sending Message

Description:

This method can be used to send message to a user

Required Parameters

  • user : str -> user_id , name or username of the recipient
  • messageText : str -> body of the message to be sent

Optional Parameter

  • image : str[path] -> path of an image as a string which can be sent

Example:

from fb_er.client import Facebook

cookies = "cookies_value"
user = Facebook(use_cookies=True, cookie=cookies)
user.send_message("Facebook_user", "Hi Sending message using fb_er")

Birthday to ICS

Description:

ICS is a CALENDER file which is supported by all major Calender , you can now get all the birthdays from of next year and import it to an ICS file , which then can be import to your favourite Calender App.

Required Parameters

  • filename : str [path] -> Path of file , where you want to create the ics file

Optional Parameter

  • event_prefix : str -> Prefix Title of Event , the script will automatically add the name of user at the end

Example:

from fb_er.client import Facebook

cookies = "cookies_value"
user = Facebook(use_cookies=True, cookie=cookies)
user.birthday_to_ics()

Updates:

Update 0.1:

  • Fixed all known bugs except login
  • Added birthday_to_ics function , which can be used to import Facebook Birthdays to ICS

fb_er's People

Contributors

mahrtayyab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.