Clarabot is a Chrome Omnibox extension which allows users to pass an image to the Chrome URL bar and have it's tags returned from the Clarifai API.
This project is essentially split into two parts - the web app and the Chrome extension. The web app is in the root, and the extension is in /extension.
Get your Clarifai credentials
To get started, create an account at developer.clarifai.com.
Create an application, and get your Client ID and Client Secret.
This basic starter uses your Client ID and Client Secret to get an access token. Since this expires every so often, the client is setup to renew the token for you automatically using your credentials so you don't have to worry about it.
Set up the web app
You'll notice that in the
.gitignore file, it references a
keys.js file. This is for security purposes, so you don't share your Client ID and Client Secret with others. Create a
keys.js file and have it look like the following:
var CLIENT_ID = 'your ID here'; var CLIENT_SECRET = 'your secret here';
The web app is pretty much good to go. It's all client-side, so will run on any web server. You may want to consider implementing a more secure way to store your keys if you are using this in production. For the sake of this quick project, this is suitable.
Set up the Chrome extension
The Chrome extension is also good to go. You'll only need to make one change to get it running, and that is to edit the roots URL of your server on line 13 of
Once this is done, you need to load the extension in to your browser. If you're unsure how to this, here's the short version:
- Navigate to chrome://extensions
- Expand the developer dropdown menu and click "Load Unpacked Extension"
- Navigate to local folder (/extensions)