How to post an online image to Twitter using NodeJS? - node.js

I am trying to post an online image (eg. https://cdn.pulselive.com/test/client/pl/dev/i/default-thumbnails/t8.png) using NodeJS and Twitter API. I have used Twit for the development, but I am not sure how to put the media type for the image. Currently, since I havent specified the media type, it is leading to an error that says please specify the type of an image.

Related

How can I download image using GridFSBucket?

I tried everything I found on internet but nothing solved my problem. I really need help on this problem.
I'm following the tutorial "How to upload/store images in MongoDB using Node.js, Express & Multer" (https://www.bezkoder.com/node-js-upload-store-images-mongodb/).
I successfully uploaded the images. I can see the images on my navigator if I use the url from my backend (http://localhost:8080/chat/files/9f722635-bffc-4d4c-aa71-340c4a488ac2.jpeg). However, I can't use this url to display the image on my frontend (react native).
The problem doesn't seem to be related to my frontend, as I can access images from any other url with the same code. Moreover, when I tried to make a GET request on the postman with the same url, the image is not displayed in the body of the response.
My code is exactly the same of the tutorial.

Facebook Graph API v10 image upload to Pages feed

I'm trying to upload a image to facebook via graph api v10.
i have followed the docs: https://developers.facebook.com/docs/graph-api/resumable-upload-api/
I'm getting the File-Handle as result, but i dont know how to append this File-handle to my Page post. Does anyone know what i can do with this File-Handle to attach it to a Post I'm automatically posting after the file upload was successful?
Thanks!
I´ve got the same problem. In the Facebook Graph API Documentation it says:
When we're done with uploading the data, you'll get a file handle:
{"h":"2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"}
This value can be used in place of an uploaded file for subsequent
graph calls.
However, no examples or further explanations are provided on how to use the received file handler.

Send image in formData without file input

I've been scouring the internet on this one, but I can't seem to find a situation exactly like what I'm trying to do....
I've built a React app (using CRA) which is used to import products from an existing eBay-like site (Reverb.com), make some small modifications, and then post them to a server which, in turn, manages the products on multiple eCommerce platforms. Pulling the data in from the Reverb.com API is easy enough; the problem comes when I submit the data to my local server's API. I need to post the product images from Reverb.com via formData without the user having to manually choose the files via a form input, but I don't have access to fs.createReadStream(). How can I get from an image URL to a file posted via formData?

How can I get individual image_urls from an Instagram album using oembed api call?

I have been using the Instagram API to get images and videos, which works just fine. I then noticed the oembed API call, which does not require an access_token, and I decided to give that a try, which also worked just great as the thumbnail_url size is adequate for most uses.
However, I noticed that the images retrieved from an album, all have a thumbnail_url that returns a 5xx Error from Instagram.
My thinking is that:
a) This is exactly how it is supposed to work and if I want images from a gallery/album, I need to use the media API call and access_token like most normal people
b) There is a way to access all images from a gallery/album and I just don't know yet. What if I want to embed the album? If this is the case, how can I check if it is an album or single image before making an API call?
Here is what I have so far:
Instagram permalink for album/gallery: https://www.instagram.com/p/BTHpAmzDHKR/
OEMBED API call: https://api.instagram.com/oembed/?url=https%3A%2F%2Fwww.instagram.com%2Fp%2FBTHpAmzDHKR%2F
thumbnail_url returned: https://scontent-dft4-2.cdninstagram.com/t51.2885-15/s612x612/e35/18012162_1608580785827161_2716056344971968512_n.jpg
media API working url for same image:
https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/18012162_1608580785827161_2716056344971968512_n.jpg
This opens up to a 5xx Server Error
Is it possible or not using oembed call?
NOTE: I am trying this just out of curiosity and not for any real app.
Closing this out as my research has shown that oembed is for single media type only, not for carousel/albums. Instagram API call which uses tokens is required.

How to post pictures to google plus using node js

I am trying to post a message or a picture to google plus, but I have no idea what kind of url or method should I use, please give me some advice.
Google Plus uses Picasa for managing photos. You can use some Picasa Module for node.js in order to upload Photos.
Here is what I've found through quick googling: https://www.temboo.com/library/Library/Google/Picasa/PostPhoto/

Resources