Open Kevinsillo opened 4 years ago
I have discovered how it is done through the official documentation of Twitter. Concatenate media_id/s with commas.
var imageOne = require('fs').readFileSync('./xxxx.jpg');
var imageTwo = require('fs').readFileSync('./yyyy.jpg');
twitter.post('media/upload', {media: imageOne}, function(error, media, response) {
var mediaOne = media.media_id_string
twitter.post('media/upload', {media: imageTwo}, function(error, media, response) {
var mediaTwo = media.media_id_string
var status = {
status: 'Text of tweet',
media_ids: mediaOne+','+mediaTwo // <------------- CONCAT WITH COMMAS
}
console.log(status)
twitter.post('statuses/update', status, async function(error, tweet, response) {
});
})
})
How upload two images? Thank you