Social Media Analyser
This Python script fetches information about a Facebook Page using the Graph API and outputs the result to output1.json
.
Before running this script, ensure you have the following installed:
- Python 3.x: Download and Install Python
- pip (Python package manager): It comes pre-installed with Python.
- Facebook App: You need to create a Facebook App to obtain the access token.
- Clone or download this repository.
- Navigate to the project directory.
Install the required Python packages:
pip install python-dotenv requests
Usage
Create .env file PAGE_ACCESS_TOKEN=your_page_access_token PAGE_ID=your_page_id
Make sure you've installed python-dotenv. Fill in your actual access token and page ID in the .env file. Run the script with Python: bash python facebook_page_info.py
Missing Variables: Ensure the .env file is in the same directory as the script or the project root. Check that the variables are correctly named and spelled. Dotenv Not Installed: Ensure that python-dotenv is installed by running: bash pip show python-dotenv