{"action":"created","issue":{"url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/47","labels_url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/47/comments","events_url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/47/events","html_url":"https://github.com/desmondmorris/node-twitter/pull/47","id":49023181,"number":47,"title":"added upload and uploadAndUpdate","user":{"login":"y-ich","id":922001,"avatar_url":"https://avatars.githubusercontent.com/u/922001?v=3","gravatar_id":"","url":"https://api.github.com/users/y-ich","html_url":"https://github.com/y-ich","followers_url":"https://api.github.com/users/y-ich/followers","following_url":"https://api.github.com/users/y-ich/following{/other_user}","gists_url":"https://api.github.com/users/y-ich/gists{/gist_id}","starred_url":"https://api.github.com/users/y-ich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-ich/subscriptions","organizations_url":"https://api.github.com/users/y-ich/orgs","repos_url":"https://api.github.com/users/y-ich/repos","events_url":"https://api.github.com/users/y-ich/events{/privacy}","received_events_url":"https://api.github.com/users/y-ich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-17T01:08:44Z","updated_at":"2015-03-07T14:22:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/desmondmorris/node-twitter/pulls/47","html_url":"https://github.com/desmondmorris/node-twitter/pull/47","diff_url":"https://github.com/desmondmorris/node-twitter/pull/47.diff","patch_url":"https://github.com/desmondmorris/node-twitter/pull/47.patch"},"body":"I added 'upload' method for uploading media API and 'uploadAndUpdate' helper method to tweet with media."},"comment":{"url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/comments/77691067","html_url":"https://github.com/desmondmorris/node-twitter/pull/47#issuecomment-77691067","issue_url":"https://api.github.com/repos/desmondmorris/node-twitter/issues/47","id":77691067,"user":{"login":"desmondmorris","id":129360,"avatar_url":"https://avatars.githubusercontent.com/u/129360?v=3","gravatar_id":"","url":"https://api.github.com/users/desmondmorris","html_url":"https://github.com/desmondmorris","followers_url":"https://api.github.com/users/desmondmorris/followers","following_url":"https://api.github.com/users/desmondmorris/following{/other_user}","gists_url":"https://api.github.com/users/desmondmorris/gists{/gist_id}","starred_url":"https://api.github.com/users/desmondmorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desmondmorris/subscriptions","organizations_url":"https://api.github.com/users/desmondmorris/orgs","repos_url":"https://api.github.com/users/desmondmorris/repos","events_url":"https://api.github.com/users/desmondmorris/events{/privacy}","received_events_url":"https://api.github.com/users/desmondmorris/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T14:22:12Z","updated_at":"2015-03-07T14:22:12Z","body":"@thepipster @y-ich convenience methods have been deprecated. \r\n\r\nAn example of uploading and tweeting an image:\r\n\r\n```javascript\r\n\r\n// Load your image\r\nvar data = require('fs').readFileSync('image.jpg');\r\n\r\n// Make post request on media endpoint. Pass file data as media parameter\r\nclient.post('media/upload', {media: data}, function(error, media, response){\r\n\r\n  if (!error) {\r\n\r\n    // If successful, a media object will be returned.\r\n    console.log(media);\r\n\r\n    // Lets tweet it\r\n    var status = {\r\n      status: 'I am a tweet',\r\n      media_ids: media.media_id_string // Pass the media id string\r\n    }\r\n\r\n    client.post('statuses/update', status, function(error, tweet, response){\r\n      if (!error) {\r\n        console.log(tweet);\r\n      }\r\n    });\r\n\r\n  }\r\n});\r\n```\r\n\r\nFrom [Examples](https://github.com/desmondmorris/node-twitter/tree/master/examples#media)"}}