Closed lshaf closed 6 years ago
Sorry, Just found it.
@lshaf: can you point me to the location where you found this information?
@pthieu I forgot about this one but I think I did it by using custom function.
private downloadImage(url: string) {
let time = Math.ceil((new Date()).getTime() / 1000);
let twitter: any = this.Twitter;
let config = twitter.config;
let options = {
url,
headers: {
"Accept": "*/*",
"User-Agent": "biolbe-client"
},
oauth: {
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
token_secret: config.access_token_secret,
token: config.access_token,
timestamp: String(time),
}
};
return new Promise((resolve, reject) => {
let bufferData: Buffer[] = [];
request.get(options).on("data", (chunk: Buffer) => {
bufferData.push(chunk);
}).on("end", () => {
resolve(Buffer.concat(bufferData));
});
});
}
and I make that function based on script at this lib
@lshaf ah thanks. I thought there was a simple convenience function you found, but looks like we have to figure it out manually.
Hi,
Can you add function to fetch DM images from ton.twitter.com ? I've read every part of your code but there's no way to call request using custom url.