A Selenium Script to post an image with text on the Facebook Groups you are member.
- Verify you have Python 2.7.x installed
$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
- Install pip
- Install python virtual environments (not required but strongly recommended).
$ pip install virtualenv
- Create your virtual environment
$ virtualenv venv
- Activate your virtual environment
$ source venv/bin/activate
- Install Python bindings for Selenium
$ (venv) pip install selenium
- Clone this repo
git clone https://github.com/lalongooo/selenium-fb-group-poster
- Move to the
selenium-fb-group-poster
$ (venv) cd selenium-fb-group-poster
There is a main
method in the script, you need to edit and provide your Facebook user and password, the message you want to post, whether you want to attache an image, along within its path and the links of the Facebook Groups you are member of:
def main():
# Your Facebook account user and password
usr = ""
pwd = ""
message = "Checkout an amazing selenium script for posting in Facebook Groups!\nhttps://github.com/lalongooo/selenium-fb-group-poster"
attach_image = True
image_path = "/path/to/the/photo/you/want/to/upload"
group_links = [
# Your Facebook Groups links.
# IMPORTANT: You must be a member of the group, being ADMIN nor required.
"https://www.facebook.com/groups/ayearofrunning/", # A group of Mark Zuckerberg
]
Run the script
$ (venv) python fbposter.py
- Provide parameters via the command line instead of editing the script.
- Improve/add exception handling
- ???
This project is licensed under the MIT license.
If you have any questions, please feel free to email me at [email protected], or better yet, fill out an issue so everyone can benefit from what's your question about.