Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/promoted_tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
line_item = account.line_items(None, campaign_ids=campaign.id).next()

# create request for a simple nullcasted tweet
tweet1 = Tweet.create(account, 'There can be only one...')
tweet1 = Tweet.create(account, text='There can be only one...')

# promote the tweet using our line item
promoted_tweet = PromotedTweet(account)
Expand All @@ -29,8 +29,8 @@

# create request for a nullcasted tweet with a website card
website_card = WebsiteCard.all(account).next()
status = "Fine. There can be two. {card_url}".format(card_url=website_card.preview_url)
tweet2 = Tweet.create(account, status)
text = "Fine. There can be two. {card_url}".format(card_url=website_card.preview_url)
tweet2 = Tweet.create(account, text)

# promote the tweet using our line item
promoted_tweet = PromotedTweet(account)
Expand Down
12 changes: 6 additions & 6 deletions examples/tweet_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
Tweet.preview(account, id=661845592138776576)

# preview a new tweet
Tweet.preview(account, status='Hello @AdsAPI!')
Tweet.preview(account, status='Hello @AdsAPI!', media_ids=[634458428836962305, 634458428836962306])
Tweet.preview(account, text='Hello @AdsAPI!')
Tweet.preview(account, text='Hello @AdsAPI!', media_ids=[634458428836962305, 634458428836962306])

# preview a new tweet with an embedded card
website_card = WebsiteCard.all(account).next()
Tweet.preview(account, status='Hello @AdsAPI!', card_id=website_card.id)
Tweet.preview(account, text='Hello @AdsAPI!', card_id=website_card.id)

# create a new null-casted tweet
Tweet.create(account, status='Hello from Python @AdsAPI!')
Tweet.create(account, status='Hello @AdsAPI!', media_ids=[634458428836962305, 634458428836962306])
Tweet.create(account, text='Hello from Python @AdsAPI!')
Tweet.create(account, text='Hello @AdsAPI!', media_ids=[634458428836962305, 634458428836962306])

# create a new null-casted tweet with an embedded card
website_card = WebsiteCard.all(account).next()
Tweet.create(account, status='Hello @AdsAPI! {link}'.format(link=website_card.preview_url))
Tweet.create(account, text='Hello @AdsAPI! {link}'.format(link=website_card.preview_url))
4 changes: 2 additions & 2 deletions twitter_ads/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ def preview(klass, account, **kwargs):
return response.body['data']

@classmethod
def create(klass, account, status, **kwargs):
def create(klass, account, **kwargs):
"""
Creates a "Promoted-Only" Tweet using the specialized Ads API end point.
"""
params = {'status': status}
params = {}
params.update(kwargs)

# handles array to string conversion for media IDs
Expand Down