ImpSdk.social.shareTwitter

developed by Timmy Luong
Demonstration:

ImpSdk.social.shareTwitter(options, callback)

Input Parameter Type Description
options Object Must have two properties: description and link.
options.description String A property of options. The tweet message. Do not include the url to be shared in this parameter. Instead, use the other link parameter below. The url will be added automatically to your tweet message.
options.link String A property of options. The url to be shared on Twitter. We use Bitly's API to shorten the url to be tweeted. Currently, each campaign will be shortened to the same url. Different campaigns will have different shortened urls.
callback Function The callback function to be executed after shareTwitter's attempt to shorten the link url by using an outside API. This callback function will be passed two arguments, an error and a response. One argument will be null and the other will be an Object depending on the response type received from the outside API. The callback will be executed as follows:

Successful: callback(null, response);
Unsuccessful: callback(error, null);
returns an object:
Property Name Type Description
description String The tweeted message.
link String The url in shortened form, appended to the tweet message.
_resourceResponse Object The data object passed to the .done callback in our $.ajax call to the url-shortener service. Sometimes this object is known as the response.
valid Boolean true if the link to be tweeted is a valid url, otherwise false.
windowUrl String The url for the window to hold the Twitter interface with the intended tweet.