It is an automated bot that searchs images (you specify which is the content) on the Google using cse (Custom Search Engine), download them and classify using the color return by a pixel array (return a pallete with the predominant colors), and send as colors classifieds images to Watson (IBM's AI) to get what is in the image, and then according to a .json file it identify if is what you want and return the best image to be posted on the Twitter account.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to use the software and how to install them
Packages:
node.js^13.5.0
npm^6.13.6
npm@get-image-colors^2.0.0,
@googleapis^46.0.0,
@ibm-watson^5.2.1,
@algorithmia^0.3.10,
@path^0.12.7,
@twit^2.2.11
To install them:
npm i <package name>
To run the bot you will need to create account Google, IBM and Twitter, to have access on Google Custom Search API's, Watson Visual Recognition API's and Twitter API's.
Fill the files on ./credentials/*.json
with the api keys from Twitter, Google and IBM.
{
"consumer_key": "12ADS21678XkjA089",
"consumer_secret": "23kK13675LKJ4552L",
"access_token": "4J1KNN6LMKL412KL42L",
"access_token_secret": "214K5KMFMKL46NLHAP9"
}
And to run the bot
npm start
To test the bot you will just need to run the follow command
- This test every function.
npm test
npm test cse
npm test watson
npm test twitter
What these test do ?
- This test the Google Custom Search Engine, and return you photos links.
npm test cse
- This test the Watson Visual Recognition and return you the detected things.
npm test watson
- This test the Twitter API and verify if the uploading and tweeting is working.
npm test twitter
To deploy it on live system is very simple, you just need to do what you've done to run in your local machine. But one thing that you'll need is an server with storage service.
- Node.js - The JavaScript runtime
- npm - The package manager
- Sublime Text - Used to code
- Google Custom Search - To search images on the internet
- IBM - Watson - To recognize the objects on the image
- Twitter API - To send and post the image on account
We use SemVer for versioning. For the versions available, see the tags on this repository.
- João Koritar - Every Work - Twitter
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
- If you want to give me a hat tip, email me at jakoritarleite@gmail.com
- My main inspiration to do that was Archillect
- [Filipe Deschamps] (https://www.youtube.com/channel/UCU5JicSrEM5A63jkJ2QvGYw) that I've looked the video-maker code to make mine better