GraphHandler
FBGraphHandler
FBGraphHandler is a Python library that simplifies the process of interacting with Facebook's Graph API. It provides methods for authenticating users, retrieving user details, posting text and video feeds, and more.
Installation
You can install FBGraphHandler using pip:
pip install FBGraphHandler
Usage
Importing FBGraphHandler
from FBGraphHandler import FBGraphHandler
Initializing FBGraphHandler
# Create an instance of FBGraphHandler
graph_handler = FBGraphHandler()
# Configure FBGraphHandler with your Facebook App credentials
graph_handler.Config(client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", version="14.0")
Generating an Authorization URL
# Generate an authorization URL for users to complete the authentication process
auth_url = graph_handler.GenerateAuthURL(redirect_uri="YOUR_REDIRECT_URI", scopes=["public_profile", "email"])
Exchanging Authorization Code for Access Token
# Exchange the authorization code for an access token
access_token = graph_handler.ExchangeCodewithToken(code="AUTHORIZATION_CODE")
Getting User Details
# Get user details using the access token
user_details = graph_handler.GetUserDetails(access_token="ACCESS_TOKEN")
Posting a Text Feed
# Post a text feed to a user or page
post_id = graph_handler.PostTextFeed(text="Hello, Facebook!", id="PAGE_OR_USER_ID", access_token="ACCESS_TOKEN")
Posting a Video Feed
# Post a video feed to a user or page
post_id = graph_handler.PostVideoFeed(text="Check out this video!", id="PAGE_OR_USER_ID", access_token="ACCESS_TOKEN", video_url="VIDEO_URL")
Posting Media (Text, Photos, or Videos)
# Post text, photos, or videos to a user or page
media_urls = ["PHOTO_URL_1", "PHOTO_URL_2"]
post_id = graph_handler.PostToFacebook(text="My Facebook post", media_urls=media_urls, access_token="ACCESS_TOKEN", id="PAGE_OR_USER_ID", isVideo=False)
Documentation
For detailed documentation and more information about available methods and parameters, please refer to the official documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for GraphHandler 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| GraphHandler-0.1.3.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| GraphHandler-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / GraphHandler-0.1.3.tar.gz
| Download URL | GraphHandler-0.1.3.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edea931f2e40c59e5dcf239b39a932d0ff4d34075f1f90afd11d5c193dabf278
|
|
BLAKE2b-256 checksum How to use checksums |
d22b4ea88ce9c155fa7c5c577f15d34e69c064021051856fa54c5a07cfb3c255
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.2
|
Release files / GraphHandler-0.1.3-py3-none-any.whl
| Download URL | GraphHandler-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adb2f0c8e7821dfef9fc4fd04fd28cf006e82784eca443ac1983ac74cd7be2db
|
|
BLAKE2b-256 checksum How to use checksums |
cb4639bf20549c72fb583957463b3890869ad675cba14856c4d682395e25d1bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.2
|