Facebook Messenger API Send Base64 Image - node.js

I am currently builidng a chatbot with nodejs. I have my Images stored in a MongoDB now I want to send a Image to facebook but I only got the Base64 String and Facebook wants an URL. Anyone who knows a solution for that?

In php you make a script to render the image, like http://someurl?img=base64string I think in node is pretty much the same workaround. Make sense for you?

Related

Is there any Back-end library to generate dynamic images (JPEG/PNG) renderred from an HTML template?

I want to know for my react native app, I want to generate a dynamic image rendered from an HTML template to share when I share something from the app to a Whatsapp contact? What should be the best way to do so? The FE or the BE? I already have puppeteer in place at the backend, but generating images using it seems quite slow, please mention if you have any puppeteer optimizations or any other library or technique? Thanks
NOTE: My B.E is in Nodejs.
emm,I do not konw any back-end library to do it.but i had development this feature by FE library.it is quickly?
FE(javascript):use library(same as html2canvas etc.) to reader from an HTML template to image base64,then post base64 data to server
BE(nodejs):use Buffer transefer to image,then save,and then response a url
thanks.

How to Serve Private Images using NodeJs (and ExpressJs?) REST

I have searched far and wide, but everyone seems to be focused on how to upload images to a NodeJs REST API. I'm already using Multer for that. Now I need to figure out how to download the private images through my REST API. When I say "private" I obviously mean that the images are specific to each user who is logged in - they are NOT publicly accessible nor are they accessible to anyone who is logged in except for the user who uploaded them. I tried ExpressJs's sendFile(), but it sends a binary file that is seemingly impossible for the client to transform and insert into an img element because it's not a blob. But what I'm REALLY asking is: Is there a mechanism/library already available to handle this, like Multer - except for DOWNLOADING PRIVATE images and letting me insert them into img elements?
Thanks for your suggestions. I'm using Vue and Vuetify on the front end, by the way.
Final solution is to use image-to-base64 (https://www.npmjs.com/package/image-to-base64) on server and download the base64 string and plug it into the img src as src="data:image/(ext);base64,...". Ref: https://en.wikipedia.org/wiki/Data_URI_scheme As you know it makes the download 33% bigger, but that's the cost of privacy! Have fun!!

Node.js and Vue.js, why Refresh make vue.js's store clear? And how can i use uploaded image in vue.js?

Title is my questions.
First. I'm making simple diary app with Node.js and Vue.js. Vue-router using history mode and in backend, using "connect-history-api-fallback" module. I think i did everything i can do, but when i run my app in local, refresh make vue.js's store clear. I googled but can't find same problem. Someone have any idea?
Second. I'm using Multer to upload. Upload is fine, i can see uploaded image. But i don't know how to show that uploaded image.
I mean in vue's template, what path will show uploaded image?
Image uploaded here "/simple-diary/backend/upload/profilePhoto/"
Vue.js component is here "/simple-diary/frontend/src/components/"
#samayo is right.One question per post.So of course when the page refresh the store is refreshed.So if you dont want that you can use plugin like vuex-persistedstate.Or if you want to keep the token and the user that is currently logged then when the user logged in,use localstorage to save the token and the user.Or cookies.Or session storage.You have many options

Node post to Facebook with Image

I have an application I am making that I want to MAKE AUTOMATIC POSTS to Facebook. This means that want an Image+text sent to facebook. The image will be an image from cloudinary (where I am hosting my App)
1)User makes post
2)Statistical Algorithm determines whether or not to post...
3) Post Sent to the Facebook Page...
How would I do this. Is there already a module?
Try facebook-node-sdk, this is module for work with facebook over nodejs.
npm install fb
Here is good documentation:
https://github.com/Thuzi/facebook-node-sdk

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