• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Bot] A twitter bot made using nodejs which can post tweets, retweet other tweets and possibly fav tweets

TwitterBot-NodeJS

Show some ❤️

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

Yeah it pretty much does what it says in the title. Its a twitter bot which can post tweets, retweet other tweets and possibly fav tweets.

This is a simple bot , to build which I had to go through a lot of information on the internet possibly because it wasn't updated/consistent. Plus I wanted to learn how build a bot anyhow ;)

Currently active bot using the same code is GDGND Bot. Hopefully it helps some other people who want to build their own bot.

Simple.Easy.Cute (Ok, last one didnot go with the flow..)

It attempts to retweet once per hour

Installation

  • Install Node.js

  • Clone this repo

       git clone https://github.com/nisrulz/twitterbot-nodejs.git
  • Run

     npm install

    It will install Twit, the library that lets us talk to Twitter.

Connecting to Twitter

  1. Register a Twitter account and also get its "app info".

    Twitter doesn't allow you to register multiple twitter accounts on the same email address. I recommend you create a brand new email address (perhaps using Gmail) for the Twitter account. Once you register the account to that email address, wait for the confirmation email.

  2. Now go here and log in as the Twitter account for your bot:

  3. Fill up the form and submit.

  4. Next once the submission completes you will be taken to a page which has the

    • "Settings" tab : Update details here
    • "Permissons" tab : Enable Read and Write
    • "Key and Access Token" tab : Click on Create my access token.
  5. Use the generated tokens in the "Key and Access Token" tab to fill the fields under the config.js file in your app directory. It should look like this:

    module.exports = {
      consumer_key:         'blah',
      consumer_secret:      'blah',
      access_token:         'blah',
      access_token_secret:  'blah'
    }
  6. Update the code under bot.js , with the your values. Best of all modify the code, tinker with it.

  7. Now type the following in the command line in your project directory:

    node bot.js

Hopefully at this point you see a message like "Success! Check your bot, it should have retweeted something." Ok it won't say that, you have to code that in. Its simple as

console.log("Success! Check your bot, it should have retweeted something.");

Check the Twitter account for your bot, and it should have retweeted a tweet with the provided hashtag.

Whats Next

You might want to push this app to a running server , probably heroku.

Note : Heroku servers would go back to sleep if there is no activity after some time, so you can have a look at Kaffeine , to keep your server active.

Do not misuse the twitter api to spam or burden the server load for twitter api , as twitter follows a strict rule of closing down accounts that do that. Please read here for the rules

Contribute

  • Star - If you like it
  • Fork - If you like to build your own version
  • File an issue - If you found a bug
  • Send a pull request - If you want to contribute

Credits

Twit Library

If you appreciate my work, consider buying me a cup of to keep me recharged 🤘 [PayPal]

License

Copyright 2016 Nishant Srivastava

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

flutter-examples

[Examples] Simple basic isolated apps, for budding flutter devs.
Dart
6,550
star
2

android-tips-tricks

☑️ [Cheatsheet] Tips and tricks for Android Development
Java
4,680
star
3

app-privacy-policy-generator

A simple web app to generate a generic privacy policy for your Android/iOS apps
Sass
3,415
star
4

sensey

⚡ [Android Library] Play with sensor events & detect gestures in a breeze.
Java
2,676
star
5

easydeviceinfo

📱 [Android Library] Get device information in a super easy way.
Java
1,736
star
6

android-examples

:shipit: [Examples] Simple basic isolated apps, for budding android devs.
Java
1,732
star
7

recyclerviewhelper

📃 [Android Library] Giving powers to RecyclerView
Java
639
star
8

qreader

🔳 [Android Library] Read QR codes using google's mobile vision api, but without the hassle
Java
368
star
9

screenshott

[Android Library] Take a screenshot of your view layout , programmatically!
Java
325
star
10

android-utils

[Android Library] Facilitating some very common functionalities in the form of utility classes for Android
Java
142
star
11

packagehunter

📥 [Android Library] Hunt down all package information
Java
140
star
12

validatetor

Android library for fast and simple string validation
Java
139
star
13

zentone

🔉 [Android Library] Easily generate audio tone of a specific frequency and volume in Android.
Kotlin
109
star
14

javadoc-themer

[Javadoc Tool] Give your boooring javadocs a splash of colors!
HTML
83
star
15

lantern

[Android Library] Handling device flash as torch for Android.
Java
82
star
16

FirebaseExample

🔥 Simplistic example app demonstrating using latest Firebase features. Checkout branches for each feature.
Java
60
star
17

UploadToBintray

[Example] Awesome library built to demonstrate the process of publishing android libraries via JCenter/Bintray
Java
53
star
18

java-interview-questions

Byte sized java tech interview coding questions
Java
43
star
19

nisrulz.github.io

Everything about Nishant Srivastava/nisrulz (online alias)
CSS
43
star
20

UploadToJitpack

[Example] Base repository to demonstrate the process of uploading an aar/jar to JitPack
Kotlin
39
star
21

OptimusHTTP

📡 [Android Library] Simplified async networking in android
Java
35
star
22

terminal-utils

[Utils] A growing list of useful terminal utility/commands and bash scripts to automate your life!
Shell
33
star
23

twitterbot-java

[Bot] Twitter bot to automate few tasks on twitter.
Java
16
star
24

ShoutOut

[Android Library] Log information in android
Kotlin
15
star
25

SelfieApp

A simple app to demonstrate building applications in android. The app lets you take selfies and show it as list inside the app.
Java
14
star
26

EvTrack

[Android Library] Make event and exception tracking like a piece of cake
Java
13
star
27

LearnKotlin

[Example] Learning Kotlin programming in Android
Kotlin
12
star
28

AndroidAutomations

An android example app to demonstrate various automations possible.
Kotlin
10
star
29

convert-md-to-pdf

Convert Markdown to PDF
JavaScript
10
star
30

puppeteer-examples

[Examples] Simple basic isolated node scripts for doing stuff with puppeteer
JavaScript
8
star
31

android-lib-init-examples

[Examples] Simple basic isolated android examples to showcase various library initialization mechanisms
Kotlin
8
star
32

SupportCamera

[Android Library] Support library to handle camera api on all android versions
Java
7
star
33

UploadToMavenCentral

[Example] Base repository to demonstrate the process of uploading an aar/jar to maven central.
Kotlin
7
star
34

nisrulz

Github Frontpage
5
star
35

ortwin-slack-bot

🛎 Your point friend in the slack workspace
JavaScript
5
star
36

Parallax-One-Pager-Template

[Template] A simple one pager parallax scrolling template
HTML
5
star
37

angular-seed

[Template] A simple angular-based seed website
CSS
4
star
38

gradle-playground

Sample project for raywenderlich.com tutorial
Kotlin
4
star
39

JetSetCompose

Example app for Jet Set Compose talk
Kotlin
4
star
40

kmp-examples

Main repository containing all the example apps demonstrating features/functionality/integrations using Kotlin MultiPlatform development.
Kotlin
4
star
41

nisrulz-android-settings

[Config] Android Studio settings and code styles used by me
3
star
42

mavenrepo

[Example] Github-Based Maven Repository
3
star
43

LearnRetrofit

[Example] Learning how to use retrofit android library
Java
3
star
44

release-automation-playstore

An automated workflow to update Playstore metadata for an android application.
Ruby
3
star
45

CoroutineRecipes

Executable example code from my talk "Cooking with Coroutines Recipes"
Kotlin
3
star
46

bygone-projects

This repository contains projects that I had worked upon in my past, possibly when I was at school (pre-college).
C++
2
star
47

advent-of-code-2021

Repository with solutions for Advent Of Code 2021 puzzles.
2
star
48

android-dev-wrapped-generator

A simple web app to generate your own Android Dev Wrapped!
HTML
2
star
49

.github

Default community health files
1
star
50

gcm-nodejs-server

[NodeJS] NodeJS GCM Server
JavaScript
1
star
51

KotlinCompileFromCmdLine

This is a repository to compile a pure kotlin project without a build system such as Gradle.
Kotlin
1
star
52

release-automation-apple-connect

An automated workflow to update Apple Appstore metadata for an iOS application.
Ruby
1
star