How to tweet text/image from javascript?

Dear All;
First of all I thank you very much for constructive presence of bolt forum members. I have some useful points in the past.
As a new topic, I need to tweet some text/image from javascript(Google Apps script). How can I do that?
What about facebook?
Check this link out, you might get an idea.