A single page app which analyses your Facebook posts using Google's Natural Language API.
This was created during my time as a student at Code Chrysalis.
A user authenticates with Facebook and connects to a Facebook App. Their user posts are downloaded, and uploaded to Google Cloud Natural Language for analysis. The results are the visualised using d3.js.
First, fork and clone this repository:
$ git clone https://github.com/[username]/am-i-nice.git
Then, run yarn to initialise the repository:
$ yarn
You will now be able to load the application. However, it won't be usable without some configuration.
You can create a Facebook App for free. Once you've created an App, you'll need the app ID. Change the variable named FB_APP_ID
in ./public/scripts/helpers.js
to match your own ID.
Add an HTTPS certificate and key to ./server
to allow the Facebook API to work:
certificate: ./server/cert.pem
key: ./server/key.pem
You can sign up here. After you sign up for access to the Natural Language API, you'll receive credentials as GOOGLE_CREDENTIALS.json
. You'll need to set two environment variables using the data contained in your own credentials file:
GOOGLE_PRIVATE_KEY: private_key
GOOGLE_CLIENT_EMAIL: client_email
You can now start the application:
$ yarn dev
You can view the application running at https://localhost:3000/.
If you wish to build a copy of the App which runs without needing babel
:
$ yarn build
$ yarn start
To remove an old build:
yarn clean
Tests are written using mocha
, chai
, and sinon
.
Start the tests by opening ./testrunner.html
in your browser.
Please feel free to contribute to this repository. Make a pull request!