From 526608b5e997ed31f350762e008b824a320a0b1b Mon Sep 17 00:00:00 2001 From: Mandy Schoep Date: Fri, 12 Feb 2021 17:10:20 +0100 Subject: [PATCH 1/4] Add approve friendship API call --- instagram_private_api/endpoints/friendships.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/instagram_private_api/endpoints/friendships.py b/instagram_private_api/endpoints/friendships.py index 5b090df3..8bfc8bbe 100644 --- a/instagram_private_api/endpoints/friendships.py +++ b/instagram_private_api/endpoints/friendships.py @@ -379,6 +379,20 @@ def ignore_user(self, user_id): params=params) return res + def approve_user(self, user_id): + """ + Approve a user's follow request. + + :param user_id: + :return: + """ + params = {'user_id': user_id, 'radio_type': self.radio_type} + params.update(self.authenticated_params) + res = self._call_api( + 'friendships/approve/{user_id!s}/'.format(**{'user_id': user_id}), + params=params) + return res + def remove_follower(self, user_id): """ Remove a follower. From 6b32b86215f86c44f1abdd8da918bac92b64f8ee Mon Sep 17 00:00:00 2001 From: Mandy Schoep Date: Fri, 12 Feb 2021 17:13:33 +0100 Subject: [PATCH 2/4] Add Github Actions lint workflow --- .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..dcc1e915 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + push: + paths: + - '*.py' + +jobs: + flake8_py3: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.7.4 + architecture: x64 + - name: Checkout PyTorch + uses: actions/checkout@master + - name: Install flake8 + run: pip install flake8 + - name: Run flake8 + uses: suo/flake8-github-action@releases/v1 + with: + checkName: 'flake8_py3' # NOTE: this needs to be the same as the job name + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From f3f254b7f90975b5594a77aa10ee6a13148a19c8 Mon Sep 17 00:00:00 2001 From: Mandy Schoep Date: Fri, 12 Feb 2021 17:17:52 +0100 Subject: [PATCH 3/4] Removed github actions lint --- .github/workflows/lint.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index dcc1e915..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint - -on: - push: - paths: - - '*.py' - -jobs: - flake8_py3: - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.7.4 - architecture: x64 - - name: Checkout PyTorch - uses: actions/checkout@master - - name: Install flake8 - run: pip install flake8 - - name: Run flake8 - uses: suo/flake8-github-action@releases/v1 - with: - checkName: 'flake8_py3' # NOTE: this needs to be the same as the job name - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 9687ce056b48d67a3e1f037ab08544408e22a446 Mon Sep 17 00:00:00 2001 From: Mandy Schoep Date: Fri, 12 Feb 2021 17:22:06 +0100 Subject: [PATCH 4/4] Run Travis on all branches --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4feba297..759cce01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,3 @@ script: - flake8 --max-line-length=120 --exclude=./setup.py,./instagram_private_api/compat.py,./instagram_web_api/compat.py,./instagram_private_api/endpoints/__init__.py - pylint -E instagram_private_api instagram_web_api -branches: - only: - - master