Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
Created January 3, 2012 04:22
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 aaronksaunders/1553464 to your computer and use it in GitHub Desktop.
Save aaronksaunders/1553464 to your computer and use it in GitHub Desktop.
new twitter upload with birdhouse example
function sendTwitterImage(_callback, _params) {
var contents = null;
var IMAGE_NOT_FOUND = {
success : false,
message : "No image provided"
};
// get the content
if(_params.image && ( typeof _params.image === "object")) {
contents = _params.image;
} else if(_params.image) {
var file = Ti.Filesystem.getFile(_params.image);
if(file.exists === false) {
return IMAGE_NOT_FOUND;
}
contents = file.read();
} else {
return IMAGE_NOT_FOUND;
}
BH.sendTwitterImage({
'status' : _params.status,
'media' : contents
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment