diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..9903544 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,34 @@ +--- +name: Bug report +about: Create a report if you're having trouble with `fbchat` + +--- + +## Description of the problem +Example: Logging in fails when the character `%` is in the password. A specific password that fails is `a_password_with_%` + +## Code to reproduce +```py +# Example code +from fbchat import Client +client = Client("[REDACTED_USERNAME]", "a_password_with_%") +``` + +## Traceback +``` +Traceback (most recent call last): + File "", line 1, in + File "[site-packages]/fbchat/client.py", line 78, in __init__ + self.login(email, password, max_tries) + File "[site-packages]/fbchat/client.py", line 407, in login + raise FBchatUserError('Login failed. Check email/password. (Failed on url: {})'.format(login_url)) +fbchat.models.FBchatUserError: Login failed. Check email/password. (Failed on url: https://m.facebook.com/login.php?login_attempt=1) +``` + +## Environment information +- Python version +- `fbchat` version +- If relevant, output from `$ python -m pip list` + +If you have done any research, include that. +Make sure to redact all personal information. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..ac0c918 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest a feature that you'd like to see implemented + +--- + +## Description +Example: There's no way to send messages to groups + +## Research (if applicable) +Example: I've found the URL `https://facebook.com/send_message.php`, to which you can send a POST requests with the following JSON: +```json +{ + "text": message_content, + "fbid": group_id, + "some_variable": ? +} +``` +But I don't know how what `some_variable` does, and it doesn't work without it. I've found some examples of `some_variable` to be: `MTIzNDU2Nzg5MA`, `MTIzNDU2Nzg5MQ` and `MTIzNDU2Nzg5Mg` diff --git a/CODE_OF_CONDUCT b/CODE_OF_CONDUCT new file mode 100644 index 0000000..1e2a33b --- /dev/null +++ b/CODE_OF_CONDUCT @@ -0,0 +1,75 @@ +Contributor Covenant Code of Conduct + +Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + + +Examples of unacceptable behavior by participants include: + + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others’ private information, such as a physical or electronic +address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + + +Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at carpedm20@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project’s leadership. + +Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..c6e0767 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,22 @@ +Contributing to fbchat +====================== + +Thanks for reading this, all contributions are very much welcome! + +Please be aware that ``fbchat`` uses `Scemantic Versioning `__ +That means that if you're submitting a breaking change, it will probably take a while before it gets considered. + +In that case, you can point your PR to the ``2.0.0-dev`` branch, where the API is being properly developed. +Otherwise, just point it to ``master``. + +Testing Environment +------------------- + +The tests use `pytest `__, and to work they need two Facebook accounts, and a group thread between these. +To set these up, you should export the following environment variables: + +``client1_email``, ``client1_password``, ``client2_email``, ``client2_password`` and ``group_id`` + +If you're not able to do this, consider simply running ``pytest -m offline``. + +And if you're adding new functionality, if possible, make sure to create a new test for it. diff --git a/LICENSE.txt b/LICENSE similarity index 85% rename from LICENSE.txt rename to LICENSE index 73f2dde..321c518 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,4 +1,4 @@ -New BSD License +BSD 3-Clause License Copyright (c) 2015, Taehoon Kim All rights reserved. @@ -13,8 +13,9 @@ modification, are permitted provided that the following conditions are met: this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* The names of its contributors may not be used to endorse or promote products - derived from this software without specific prior written permission. +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE diff --git a/MANIFEST.in b/MANIFEST.in index 97e2ad3..57c2977 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ -include LICENSE.txt +include LICENSE +include CONTRIBUTING.rst include README.rst diff --git a/README.rst b/README.rst index 441e203..718a7f3 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,8 @@ fbchat: Facebook Chat (Messenger) for Python ============================================ .. image:: https://img.shields.io/badge/license-BSD-blue.svg - :target: LICENSE.txt - :alt: License: BSD + :target: https://github.com/carpedm20/fbchat/tree/master/LICENSE + :alt: License: BSD 3-Clause .. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6%20pypy-blue.svg :target: https://pypi.python.org/pypi/fbchat diff --git a/fbchat/__init__.py b/fbchat/__init__.py index 2b92a3f..8b048df 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -7,7 +7,7 @@ Facebook Chat (Messenger) for Python :copyright: (c) 2015 - 2018 by Taehoon Kim - :license: BSD, see LICENSE for more details. + :license: BSD 3-Clause, see LICENSE for more details. """ from __future__ import unicode_literals @@ -19,7 +19,7 @@ __version__ = '1.3.9' __description__ = 'Facebook Chat (Messenger) for Python' __copyright__ = 'Copyright 2015 - 2018 by Taehoon Kim' -__license__ = 'BSD' +__license__ = 'BSD 3-Clause' __author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart' __email__ = 'carpedm20@gmail.com' diff --git a/setup.cfg b/setup.cfg index dbd7670..b554b7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ [metadata] name = fbchat version = attr: fbchat.__version__ -license = BSD -license_file = LICENSE.txt +license = BSD 3-Clause +license_file = LICENSE author = Taehoon Kim author_email = carpedm20@gmail.com