Any libraries that can make accessing Google APIs as a service account simpler for NodeJS? - node.js

Background: My idea is to create a primarily content-heavy website (think news articles or blog posts) written entirely in nodejs. Since creating content on Google Drive (Google Docs) in particular is very simple, what I would like to do is have Nodejs retrieve the website's content from Google Docs.
Challenge: As far as I can tell, the correct way to do this according to Google is to create a Service Account so that the application can access the files stored on Google Drive without requiring user-intervention in the form of a confirmation. Google provides three libraries--java, python, and php--for server-to-server requests. Does anyone know of anything similar already written by the Node community? I am aware of node-oauth but I've searched through it's source and haven't found anything referencing private keys, which are required for server-to-server interaction, which I'm taking to mean it's not supported. Writing one is also an option, but I'd like to avoid that if at all possible. Looking at the Google-written Java Oauth2 client library makes it pretty clear that it's not an easy task.
Thanks in advance!

This is one library I've found that looks pretty thorough and complete for creating JSON Web Tokens: JWCrypto

I know this thread is old, but in the event others arrive here looking for an answer:
Google is working on an official module to access all of their API's. Its alpha so be careful but it looks very nice- github repository

Related

How to access Google Classroom without API?

I'd like to automatize some processes that are not yet available through API(Google Classroom), like posting comments on announcements, seeing private comments on my work and so on. I have trouble accessing my account. I'd like the app to be able to run on a server. I'm currently working with node.js, but if there is an easier approach I'll gladly accept it (free if it's possible). Can you give me an example of how it's done because currently, I am struggling to find every button that needs to be clicked on?
Unfortunately, there are no methods right now to accomplish that. You can leave a feature request on Google Issue Tracker describing what methods you would like to use. Google engineers will study your case and, if applicable, they will develop the requested methods.
You could use something like Selenium with your language of choice (Javascript in this case) to automate the browser clicks.
This is however, not the best of ideas... To make Selenium log into your account you will need to hardcode your password somewhere.
Google services use Oauth for authentication, take a look at the Classroom API Getting-started for instructions on how to work with Google Classroom API.

Azure Mobile services : using shared libraries in Custom API

Azure Mobile services (node.js backend) : I remember vaguely sometime back I had read somewhere that the shared libraries cannot be used in Custom API, however I don't remember where exactly I read that. Tried googling, searching here in SO, but didn't find anything. Now that I started coding my Custom API, I need to know this for sure, whether what I remember vaguely is really true or not; if someone has any idea about this, I'll much appreciate if you can confirm.
many thanks.
Yes you can create shared scripts and use them from your mobile service custom API scripts.
See this link for enabling source control and getting a local copy so you can create and push your scripts: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-store-scripts-source-control/#use-npm
Then take a look at this link for more on using some of the "native" node modules or helper functions: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-how-to-use-server-scripts/#shared-code

Is there any Web API for Google web clipboard?

Google Docs have a feature "Web Clipboard" to help users easily copy and paste cross google documents. (you can refer to https://drive.googleblog.com/2010/02/a-web-clipboard-for-google-docs.html)
But I am wondering that if there's any Web API or official way to access those API.
I try to find in Google Document List APi (https://developers.google.com/google-apps/documents-list/), I can't find any related stuff.
The original goal for me is I want to copy some screenshot/images/text from my Windows OS.
And I want to paste into my GoogleDoc Document.
But it can't be done unless the screenshot/image/text is update/upload into Web Clipboard.
I keep finding any related integrated tools or extension, but I still can't find anyone.
Could someone give me some suggestions?
There is no official way to access this API, sorry.
There is clearly an API of sorts, just not documented. I'd suggest looking at extensions like this one and trying to reverse-engineer the protocol so you can see what endpoints it is calling.
But it sounds like a lot of work.

How do I access Google AdWords API with Node.js?

Is there a way to use node.js to access and manage a google adwords account?
I'm the author of an unofficial node.js client library for AdWords: https://www.npmjs.com/package/googleads-node-lib. It is getting closer to a feature complete client library every day. Pull requests welcome.
Yes, the library uses standard Javascript (it is built using Google's Closure library). What you might need to do is to write an HttpWebTransport adapter that works for Node.js. http://code.google.com/p/google-api-adwords-js/source/browse/#svn%2Ftrunk%2Fjs%2Fsystem%2Fsrc%2Fgoogle%2Fsystem%2Fnet has a few examples for specific technlogies like Google Gadgets, Chrome extensions, etc. , but there isn't one for Node.js. Also see http://code.google.com/p/google-api-adwords-js/source/browse/trunk/js/adwordsapi/src/config.js for details on how to configure the library to use a particular HttpWebTransport class.
Cheers,
Anash
I don't know much about node.js but if it's using standard JavaScript then you should be able to get somewhere with the new AdWords API JavaScript library: http://code.google.com/p/google-api-adwords-js/

How to access Wikipedia using Node.js

I am looking into the simplest way to integrate Wikipedia into a node.js app.
The requirements are to be able to search for entries and find entities in each entry.
Any known existing libs/methods for that?
Thanks
There's a newly available open source parser for wiki text (http://sweble.org/) that might be useful to you if you roll your own solution. Of course that would require you downloading the wikipedia data dump, parsing, and storing entities in a db.
You could also look at dbpedia (http://dbpedia.org/About), though that would require integrating the rdf stack into your app (either running a local rdf repository or communicating with the often flaky online version via sparql).
One easy approach is to use a search engine api and restrict to site:wikipedia.org - e.g:
http://www.google.com/search?q=node.js+site%3Awikipedia.org
I've found that can work really well.
Spider for scraping using jquery is fantastic:
https://github.com/mikeal/spider
Mikeal is the man
Presumably you'd be using this for a side (personal) project though. Not sure how kosher it is to run wild on wikipedia with a scraper.

Resources