Google feed api in a nodejs application? - node.js

I have a php application that uses the google feed api to get the feeds I want and display them. I was wondering how can I call the google feed api from a nodejs application ?

Use node's http.request() (or the shortcut version http.get()) functionality; that's conceptually the same thing you must be currently doing in PHP.
You might find that installing and using Mikeal's request module would make things even simpler.

Related

React- Router vs Node.js

I am fairly new to the web development and I am still learning.
I am trying to build a back end for my web application. I am currently using react with redux for my front end. My question is, in order to create a back end do I need to use the react-router or do I have to use a completely different platform like Node.js. Thank you in advance!!
In order to create a backend, you will need to build a server-side application using Node, .NET Core, Java, PHP... and the list goes on. Seems like you're into JS, so Node would likely be your choice. You have a few options, such as embedding your frontend application in views served by your backend, or keeping them separate, like a frontend talking to API endpoints using the Fetch API.
React-router, on the other hand, will allow you to move through the different screens of the single-page app you've created. It won't help you to make API endpoint calls.
So, as you can see, the two things aren't related even though they sound similar. In short, use react-router to navigate around your app, and use the Fetch API (or a component like Axios that has better compatibility for older browsers) to make your API endpoint requests.

Using node/vuejs, how to make google place API request on client side

I am using vuejs which runs as a single page application in the browser, so any API calls I am making are using axios. Unfortunately googles APIs block any requests through axios due to CORS. I have tried various npm packages to try and solve this, including "official" google maps package, but I still run into CORS issues.
I am positive there must be a way to do a placeid search through the browser using one of their javascript libraries, but I can't for the life of me find any good articles or examples to see how it is done.
I have google autocomplete working, and creating google maps through geocode is no problem, just can't find anything related to placeid search.
Here is an example of the request I am trying to make taken from googles docs.
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=YOUR_API_KEY
Can anyone provide a solution or link to an explanation on how to do this properly through javascript library, or through API call without running into CORS problems?
Your link to Google Maps Package is Node.js package (server side). That's why you have CORS issue.
If you're building a client-side application, take a look at the
Places SDK for Android, the Places SDK for iOS, and the Places
Library, Maps JavaScript API.
If you want to use it Google Maps on client side, you should use Maps JavaScript API

Olark like software in node.js needed

Do you know any node.js application that do something similar to http://olark.com. Not necessarily for multiple website, I just need it for single domain.
I just want to install it myself on heroku and run chat customer support for my website on it.
Thanks,
Michal
Try out opensource-olark. I built it for my own use - it may be useful to you. It is not entirely based on Nodejs. But it works exactly like Olark. It uses strophe.js - A xmpp push based library for jabber which works with BOSH
try http://www.vivocha.com, based on node.js
It's very symple to use and you can integrate with other applications via API (with CRMs and ticketing systems for exemple).
This platform, with only one line of code on your website, allow you to configure all the widgets, without other tech skills needed.
And also, you can adding voice on your website, so you can call with your visitors directly on your web pages.
There are open source tools that you can check out like :
http://nowjs.com
http://www.socketstream.org
They allow you to incorporate realtime features into your nodejs app & you can probably have a very simplified olark-type app in just a couple lines of code.

node.js - replace PHP, and asynchronously connect to it

Recently I started playing with node.js.
Since I'm developing a web app, I was interested in the benefits of google's javascript V8 engine, i started reading stuff about all this - and node.js.
An example of a webapp which uses node.js: http://bodesigns.com/simple-web-app-using-node-js/
As you can see, it uses node.js to connect to a mysql database. Some questions about this:
- First of all, is this safe? I mean: the username and password are stored in the file. I know, in PHP it is to, but a PHP-file is server-side. Node.js is server-side?
Second, with this (i'm also building a part of the web app with google maps stuff), i could replace the PHP-code I have now to collect some data from a mysql database? What are the (dis)advantages of replacing the PHP-code with node.js code?
Last: can I run a node.js server asynchronously? I mean: i have a HTML-page with a link (). When i click it, it must "run" the node.js-script, which collects data form the mysql-database. Like in the example. So when the page loads, only an empty map has to be visible. If you click something, markers have to show or hide. Is this possible?
My apologies for my bad English.
First of all, is this save?
node.js runs on the server, the code doesn't need to go to the client so it's safe.
What are the (dis)advantages of replacing the PHP-code with node.js code?
Do you need to rewrite code that already works? If your writing new code then PHP vs node.js is a completely different and application specific discussion. For generic applications they are both suitable
Is this possible?
Yes, however it's also possible with PHP.

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/

Resources