srpablino / ml-talk-demos

Code for the demos from my Google Next '17 talk: https://youtu.be/w1xNTLH1zlA and I/O '17 talk: https://www.youtube.com/watch?v=ETeeSYMGZn0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is not an official Google product

Natural Language API + Firebase realtime Twitter dashboard demo

  1. cd into ml-talk-demos/
  2. Create a project in the Firebase console and install the Firebase CLI
  3. cd into the frontend/ directory and run firebase login and firebase init to associate this with the Firebase project you just created. When prompted, don't overwrite existing files. Create a database and hosting project (no Functions).
  4. In your Firebase console, click "Add Firebase to your web app". Copy the credentials to the top of the main.js file
  5. cd into the backend/ directory and run npm install to install dependencies
  6. Generate a service account for your project by navigating to the "Project settings" tab in your Firebase console and then selecting "Service Accouts". Click "Generate New Private Key" and save this in your backend/ directory as keyfile.json
  7. Generate Twitter Streaming API credentials and copy them to backend/local.json
  8. Navigate to the Cloud console for our project. Enabled the Natural Language API and generate an API key. Replace YOUR-API-KEY in backend/local.json with this key.
  9. Replace searchTerms in backend/index.js with the search terms you'd like to filter tweets on
  10. Replace FIREBASE-PROJECT-ID in backend/local.json with the id of your Firebase project
  11. Run the server: from the backend/ directory run node index.js. You should see tweet data being written to your Firebase database
  12. In a separate terminal process, run the frontend: from the frontend/ directory run firebase serve
  13. Deploy your frontend: from the frontend/ directory run firebase deploy

About

Code for the demos from my Google Next '17 talk: https://youtu.be/w1xNTLH1zlA and I/O '17 talk: https://www.youtube.com/watch?v=ETeeSYMGZn0

License:Apache License 2.0


Languages

Language:JavaScript 73.7%Language:HTML 21.3%Language:CSS 5.0%