├── .gitignore ├── demo.gif ├── likebot.js ├── package.json ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | .DS_Store -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martinm/twitter-like-bot/HEAD/demo.gif -------------------------------------------------------------------------------- /likebot.js: -------------------------------------------------------------------------------- 1 | const Twitter = require('twitter'); 2 | const client = new Twitter({ 3 | consumer_key: '', 4 | consumer_secret: '', 5 | access_token_key: '', 6 | access_token_secret: '' 7 | }); 8 | 9 | const stream = client.stream('statuses/filter', {track:'#IlikeBots, #keyword2'}); 10 | 11 | stream.on('data', (event) => { 12 | client.post('favorites/create', {id:event.id_str}, (error, response) => { 13 | if(error) throw error; 14 | console.log('Tweet ID: '+response.id_str+' Liked! - "'+response.text+'"') 15 | }); 16 | 17 | }); 18 | 19 | stream.on('error', (error) => { 20 | throw error; 21 | }); 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitter-like-bot", 3 | "version": "1.0.0", 4 | "description": "Before you start, download NodeJS & NPM https://nodejs.org/en/download/", 5 | "main": "likebot.js", 6 | "scripts": { 7 | "test": "node likebot.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/martinm/twitter-like-bot.git" 12 | }, 13 | "author": "Martin Malinowski", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/martinm/twitter-like-bot/issues" 17 | }, 18 | "homepage": "https://github.com/martinm/twitter-like-bot#readme", 19 | "dependencies": { 20 | "twitter": "^1.7.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Martin Malinowski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # readme | twitter-like-bot 2 | This app allows you to automate Twitter liking for specific keywords, hashtags, or even full sentences. The bot uses streaming API which means that everything happens in real time. 3 | 4 | ![](https://github.com/martinm/twitter-like-bot/blob/master/demo.gif) 5 | 6 | ## create Twitter developer account 7 | [Apply for access — Twitter Developers](https://developer.twitter.com/en/apply-for-access) 8 | from the developer dashboard, create new Twitter app 9 | 10 | ## install node.js 11 | [download & install Node.js](https://nodejs.org/en/download/) 12 | [alternatively install via your package manager](https://nodejs.org/en/download/package-manager/#macos) 13 | 14 | macOS 15 | ``` 16 | curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/" 17 | ``` 18 | 19 | Debian & Ubuntu 20 | ``` 21 | curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - 22 | sudo apt-get install -y nodejs 23 | ``` 24 | 25 | 26 | ## how to use? 27 | cd to the project folder and install packages 28 | `npm i` 29 | 30 | enter your Twitter app keys & tokens 31 | ``` javascript 32 | const client = new Twitter({ 33 | consumer_key: '', 34 | consumer_secret: '', 35 | access_token_key: '', 36 | access_token_secret: '' 37 | }); 38 | ``` 39 | 40 | enter keywords, hashtags or sentences that you want to track 41 | ``` javascript 42 | const stream = client.stream('statuses/filter', {track:'#example1, #example2’}); 43 | ``` 44 | 45 | cd to the project folder and start the bot: 46 | `npm test` or alternatively `node likebot.js` 47 | 48 | 49 | --------------------------------------------------------------------------------