Skip to content

Instantly share code, notes, and snippets.

@rampicos
Created October 5, 2015 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rampicos/230476d230abde2ee714 to your computer and use it in GitHub Desktop.
Save rampicos/230476d230abde2ee714 to your computer and use it in GitHub Desktop.
//social.js available at https://gist.github.com/rampicos/4320296
var social = require('social');
var twitter = social.create({
consumerSecret : TWITTER_CONSUMER_SECRET,
consumerKey : TWITTER_CONSUMER_KEY
});
twitter.authorize();
twitter.share({
message : "Message to Share",
success : function() {
alert("Tweeted Successfully");
},
error : function() {
alert("Error while tweet");
}
});
twitter.shareImage({
message : messageContent,
image : (Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "KS_nav_ui.png")).read(),
success : function() {
alert("Tweeted Successfully");
},
error : function() {
alert("Error while tweet");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment