fbn


Namefbn JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/viseshrp/fbn
SummaryTool to monitor fb groups and notify
upload_time2023-07-13 04:17:22
maintainerVisesh Prasad
docs_urlNone
authorVisesh Prasad
requires_python>=3.7
licenseMIT license
keywords fb fbn facebook group notify monitor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # fbn
#### Tool to monitor fb groups and notify.
This was a small holiday project. I just absolutely hate being on Facebook.
The UI, the clunky android app.. Ughh. I uninstalled it a long time ago and just use the
mobile site.
I hate that I am forced to be on it, sometimes, because there is
valuable information from folks on there in some communities I am a part of. This tool
is to remove the need for me to keep watching these groups constantly.

```sh
$ pip install fbn

$ fbn --help
Usage: fbn [OPTIONS]

  Simple CLI tool to look for new posts in a Facebook group and then send you
  a notification. Public groups do not require authentication information.

  Example usage:

  $ export FBN_APPRISE_URL=mailto://gmailusername:gmailpassword@gmail.com

  $ fbn --id craigslist --every 45m --cookies-file facebook.com_cookies.txt
  --verbose

Options:
  -v, --version               Show the version and exit.
  -i, --id TEXT               The Facebook group name or id  [required]
  -u, --username TEXT         Your Facebook username  [env var:
                              FBN_FB_USERNAME]
  -p, --password TEXT         Your Facebook password  [env var:
                              FBN_FB_PASSWORD]
  -c, --cookies-file FILE     Path to the Facebook cookies file
  -g, --user-agent TEXT       User agent to use for scraping
  -s, --sample-count INTEGER  Number of posts to sample  [default: 10]
  -e, --every TEXT            Monitor frequency. Of the form <int><m/h/d/w>.
                              Eg: --every 2m. Will check every 2 minutes.
  -t, --to TEXT               Monitor randomization frequency. Requires
                              --every. Same form as --every. Both units must
                              match. Eg: --every 1h --to 2h. Will randomize
                              checks every 1 to 2 hours.
  -a, --apprise-url TEXT      The apprise URL to notify  [env var:
                              FBN_APPRISE_URL; required]
  --include-errors            Notify of errors as well.
  -v, --verbose               Enable debug logging.
  -h, --help                  Show this message and exit.
```

This uses [facebook-scraper](https://github.com/kevinzg/facebook-scraper) that scrapes the target group for posts.
If the group is private, authentication is required as you must be a member,
obviously. Auth can be passed using the CLI options or the env vars `FBN_FB_USERNAME` or `FBN_FB_PASSWORD`.
Auth can also be passed in the form of cookies in Netscape or JSON format. Use the CLI option.
You can extract cookies from your browser after logging into Facebook with
an extension like [Get cookies.txt LOCALLY (Chrome)](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc/)
or [Cookie Quick Manager (Firefox)](https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/).
Make sure that you include both the c_user cookie and the xs cookie, 
you will get an InvalidCookies exception if you don't.

*Since this is a scraper, the more frequently you scrape, the more the chances are of getting locked out of your account
or even banned permanently. The tool detects temporary bans and backs off appropriately, but [be warned](https://github.com/kevinzg/facebook-scraper/issues/409#issuecomment-907639417).*
You may see `ConnectionResetError: [Errno 54] Connection reset by peer` for the URL `https://m.facebook.com/settings` from time to time. This is possibly because you are scraping too often. Reduce your frequency and/or rotate cookies to fix this. More info [here](https://github.com/kevinzg/facebook-scraper/issues/763).

If you do not provide a value for `--every`, fbn will automatically randomize the checks to once between 2-4 hours which works out a lot better in terms of scraping frequency.

Notifications are sent through the amazing [Apprise](https://github.com/caronc/apprise) which supports a ton of 
[notification services](https://github.com/caronc/apprise/wiki#notification-services). Use the CLI option
 or env var `FBN_APPRISE_URL` to set that.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/viseshrp/fbn",
    "name": "fbn",
    "maintainer": "Visesh Prasad",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "visesh@live.com",
    "keywords": "fb fbn facebook group notify monitor",
    "author": "Visesh Prasad",
    "author_email": "visesh@live.com",
    "download_url": "",
    "platform": null,
    "description": "# fbn\n#### Tool to monitor fb groups and notify.\nThis was a small holiday project. I just absolutely hate being on Facebook.\nThe UI, the clunky android app.. Ughh. I uninstalled it a long time ago and just use the\nmobile site.\nI hate that I am forced to be on it, sometimes, because there is\nvaluable information from folks on there in some communities I am a part of. This tool\nis to remove the need for me to keep watching these groups constantly.\n\n```sh\n$ pip install fbn\n\n$ fbn --help\nUsage: fbn [OPTIONS]\n\n  Simple CLI tool to look for new posts in a Facebook group and then send you\n  a notification. Public groups do not require authentication information.\n\n  Example usage:\n\n  $ export FBN_APPRISE_URL=mailto://gmailusername:gmailpassword@gmail.com\n\n  $ fbn --id craigslist --every 45m --cookies-file facebook.com_cookies.txt\n  --verbose\n\nOptions:\n  -v, --version               Show the version and exit.\n  -i, --id TEXT               The Facebook group name or id  [required]\n  -u, --username TEXT         Your Facebook username  [env var:\n                              FBN_FB_USERNAME]\n  -p, --password TEXT         Your Facebook password  [env var:\n                              FBN_FB_PASSWORD]\n  -c, --cookies-file FILE     Path to the Facebook cookies file\n  -g, --user-agent TEXT       User agent to use for scraping\n  -s, --sample-count INTEGER  Number of posts to sample  [default: 10]\n  -e, --every TEXT            Monitor frequency. Of the form <int><m/h/d/w>.\n                              Eg: --every 2m. Will check every 2 minutes.\n  -t, --to TEXT               Monitor randomization frequency. Requires\n                              --every. Same form as --every. Both units must\n                              match. Eg: --every 1h --to 2h. Will randomize\n                              checks every 1 to 2 hours.\n  -a, --apprise-url TEXT      The apprise URL to notify  [env var:\n                              FBN_APPRISE_URL; required]\n  --include-errors            Notify of errors as well.\n  -v, --verbose               Enable debug logging.\n  -h, --help                  Show this message and exit.\n```\n\nThis uses [facebook-scraper](https://github.com/kevinzg/facebook-scraper) that scrapes the target group for posts.\nIf the group is private, authentication is required as you must be a member,\nobviously. Auth can be passed using the CLI options or the env vars `FBN_FB_USERNAME` or `FBN_FB_PASSWORD`.\nAuth can also be passed in the form of cookies in Netscape or JSON format. Use the CLI option.\nYou can extract cookies from your browser after logging into Facebook with\nan extension like [Get cookies.txt LOCALLY (Chrome)](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc/)\nor [Cookie Quick Manager (Firefox)](https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/).\nMake sure that you include both the c_user cookie and the xs cookie, \nyou will get an InvalidCookies exception if you don't.\n\n*Since this is a scraper, the more frequently you scrape, the more the chances are of getting locked out of your account\nor even banned permanently. The tool detects temporary bans and backs off appropriately, but [be warned](https://github.com/kevinzg/facebook-scraper/issues/409#issuecomment-907639417).*\nYou may see `ConnectionResetError: [Errno 54] Connection reset by peer` for the URL `https://m.facebook.com/settings` from time to time. This is possibly because you are scraping too often. Reduce your frequency and/or rotate cookies to fix this. More info [here](https://github.com/kevinzg/facebook-scraper/issues/763).\n\nIf you do not provide a value for `--every`, fbn will automatically randomize the checks to once between 2-4 hours which works out a lot better in terms of scraping frequency.\n\nNotifications are sent through the amazing [Apprise](https://github.com/caronc/apprise) which supports a ton of \n[notification services](https://github.com/caronc/apprise/wiki#notification-services). Use the CLI option\n or env var `FBN_APPRISE_URL` to set that.\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Tool to monitor fb groups and notify",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/viseshrp/fbn/issues",
        "Changelog": "https://github.com/viseshrp/fbn/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/viseshrp/fbn",
        "Homepage": "https://github.com/viseshrp/fbn",
        "Source Code": "https://github.com/viseshrp/fbn"
    },
    "split_keywords": [
        "fb",
        "fbn",
        "facebook",
        "group",
        "notify",
        "monitor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "02d69913034618b9fcbd84573536801bf4bc56c481dc25e723c02697e0d8f111",
                "md5": "7c6be5b43f25bd993b3a8ea56d06d925",
                "sha256": "ca9cdae63c4036c132228fc8add0204d4138408e61b82dfa28b5f07ab18c0042"
            },
            "downloads": -1,
            "filename": "fbn-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c6be5b43f25bd993b3a8ea56d06d925",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8844,
            "upload_time": "2023-07-13T04:17:22",
            "upload_time_iso_8601": "2023-07-13T04:17:22.433673Z",
            "url": "https://files.pythonhosted.org/packages/02/d6/9913034618b9fcbd84573536801bf4bc56c481dc25e723c02697e0d8f111/fbn-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 04:17:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "viseshrp",
    "github_project": "fbn",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fbn"
}
        
Elapsed time: 0.09677s