Update two example files to API version 2.9 #346

Merged
merged 2 commits into from Jan 18, 2018

Conversation

Projects
None yet
5 participants
Contributor

kevinqz commented May 22, 2017

Update example files to API version 2.9:

  • simple_create.py
  • ad_creation_utils.py
Update two example files to API version 2.9
Update example files to API version 2.9:
- simple_create.py
- ad_creation_utils.py

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Contributor

kevinqz commented Jun 20, 2017

Guys, I updated the files considering the new version of the API, is there anything I can improve for the Pull Request to be accepted?

Why is this not merged?

examples/ad_creation_utils.py
- AdCreative,
- TargetingSpecsField,
-)
+from facebookads.adobjects.adaccount import AdAccount
@daphyFB

daphyFB Jul 3, 2017

Contributor

AdAccount is not used anywhere else in the file.

examples/ad_creation_utils.py
+from facebookads.adobjects.ad import Ad
+from facebookads.adobjects.adimage import AdImage
+from facebookads.adobjects.adcreative import AdCreative
+from facebookads.adobjects.targetinggeolocation import TargetingGeoLocation
@daphyFB

daphyFB Jul 3, 2017

Contributor

ditto. This is not used anywhere else in the file.

Thanks for the pull request! If you could update those nit and remove the two unnecessary import, I'll work on merging it. Thanks!

examples/simple_create.py
daily_budget=1000, # $10.00 per day
age_min=13,
age_max=65,
- paused=True, # Default is False but let's keep this test ad paused
+ campaign=config['campaign_id'],
+ status=AdSet.Status.paused, # Default is False but let's keep this test ad paused
@daphyFB

daphyFB Jul 3, 2017

Contributor

line too long; prefer 80 characters

examples/simple_create.py
- preview = my_ad.get_ad_preview(params={
- AdPreview.Field.ad_format: AdPreview.AdFormat.right_column_standard
+ preview = my_ad.get_previews(params={
+ 'ad_format': AdPreview.AdFormat.right_column_standard,
@daphyFB

daphyFB Jul 3, 2017

Contributor

two spaces after ':'

Contributor

kevinqz commented Jul 16, 2017

Thanks for the update, @daphyFB! I've just updated the codes in a new commit.

@kevinqz kevinqz referenced this pull request Jul 22, 2017

Closed

Broken examples #373

@xiaotchen xiaotchen merged commit 08b84ef into facebook:master Jan 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment