You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I don't know is this feature already exist or not because I can't find clear documentation about this, I need to make request that respond binary file (twitter media/image) so I can download it, here is my sample code :
var file = fs.createWriteStream('./img/'+moment().unix()+'.jpg');
//this get request should return binary based
get( https://ton.twitter.com/1.1/ton/data/dm/1247396998774280197/1247396972383764481/9pT24oPh.jpg,
access_token_key,
access_token_secret
).then((img) => {
console.log(img);
})
return 'ok'
}`
The text was updated successfully, but these errors were encountered:
rogers-dwiputra
changed the title
Customer Header for Binary Request (Twitter Media Download)
Custom Header for Binary Request (Twitter Media Download)
Apr 8, 2020
Hi, I don't know is this feature already exist or not because I can't find clear documentation about this, I need to make request that respond binary file (twitter media/image) so I can download it, here is my sample code :
`async function getTwitterUserProfileWithOAuth1 (username = 'youritguy4') {
var oauth = new OAuth.OAuth(
'https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
consumer_key,
consumer_secret,
'1.0A', null, 'HMAC-SHA1'
)
const get = promisify(oauth.get.bind(oauth))
var file = fs.createWriteStream('./img/'+moment().unix()+'.jpg');
//this get request should return binary based
get(
https://ton.twitter.com/1.1/ton/data/dm/1247396998774280197/1247396972383764481/9pT24oPh.jpg
,access_token_key,
access_token_secret
).then((img) => {
console.log(img);
})
return 'ok'
}`
The text was updated successfully, but these errors were encountered: