Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed put_photo to put_media, now supports photo and video upload #1

Open
wants to merge 377 commits into
base: master
Choose a base branch
from

Conversation

percy3d
Copy link
Owner

@percy3d percy3d commented Dec 12, 2014

Hi,

I actually made this change a while ago(about a year ago). I needed to post video. I changed put_photo to put_media.

 def put_media(self, media_path, album_id=None, is_image=True, **kwargs):

The method will properly encode the file contents and post it using the appropriate url, either graph.facebook.com or graph-video.facebook.com.

to post a video:

  kwargs = {'title':'testing', 'description':'just a test'}
  graph = facebook.GraphAPI(oauth_access_token)
  graph.put_media(os.path.join(os.getcwd(), '<sample_video>.mp4'), None, False, **kwargs)

To post a photo:

  graph = facebook.GraphAPI(user['access_token'])
  graph.put_media(os.path.join(os.getcwd(), '<sample_photo>.jpg'), None, True, **kwargs)

Thank you for your time.

martey and others added 30 commits May 6, 2015 17:11
  - Add Python 3.4 to tested Python versions.
  - Run flake8 tests after main test suite.
Update login button permissions in Flask example.
Add new documentation explaining how to use the SDK with Flask (use
example), Google App Engine (enable billing), and Tornado (use example).

This is stub documentation, so pull requests are welcome!
Remove outdated examples and documentation relating to Google App
Engine. Note that nothing in this merge makes it more difficult for
people to use Google App Engine.

Close #90. Close #100. Close #107. Fix #215 with 3e01906.
Update installation instructions so that people stop installing 0.4.0
and then complaining when documentation from the unreleased version from
Git does not work.
Convert valid_API_versions to a module-level constant in order to
simplify adding new versions by making version tests more dynamic.
Fix formatting of code blocks in installation instructions.
Test cases are based on official Facebook PHP SDK tests: https://github.com/facebookarchive/facebook-php-sdk/blob/master/tests/tests.php

Thank you for your hard work!
Do not bother to try checking Python system version, just always use
Python 2.6 workaround.
Remove "test_with_only_params" test that no longer worked (it's not
possible to query Facebook users by their username). Move remaining
tests into new AccessToken test case.
The data that `base64.urlsafe_b64decode` creats are returned as a
byte-string in Python 3. We pass this on to `json.loads` which only
allows strings, and not byte-strings. So this commit fixes this by
decoding data so that it becomes a normal string in Python 3.
Verify that parse_signed_request returns True with valid payload. This
avoids the test failing with a confusing TypeError if the cookie is
invalid for some reason.
martey and others added 30 commits September 1, 2019 17:07
Temporarily comment out `test_function_returns_correct_connections`
automated test.
  - Install mock package in CircleCI configuration when running tests in
    Python 2.
  - Abstract adding a parameter to post_args or args to reduce code
    duplication between adding access token and application secret
    proofs.

Co-authored-by: Travis Thieman <[email protected]>
Co-authored-by: Christian Ledermann <[email protected]>
Co-authored-by: Dmytro Litvinov <[email protected]>
Co-authored-by: Martey Dodoo <[email protected]>
Use "-m unittest discover" instead of manually calling the
`test_facebook` script. This allows us to use the entire `test`
directory.
  - Reorganize automated tests into multiple files.
  - Rename test case objects to make it clearer than they inherit from
    FacebookTestCase.
  - Remove broken `test_request` test case.
Add `error_subcode` field to GraphAPIError objects if it exists.

Close #432. Close #453.

Co-authored-by: Martey Dodoo <[email protected]>
  - Remove deprecated version 2.10.
  - Add new version 5.0.
  - Remove support for Python 2.7 and 3.4.
  - Add support for Python 3.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.