GithubHelp home page GithubHelp logo

msg-on-twitter-follow's Introduction

msg-on-twitter-follow

This app monitors your Twitter feed. When someone new follows you on Twitter, it automatically follows them back and sends them a welcome message.

You can configure the message to send using Merge Tags in the form %FIELD_NAME% like: %DAY_OF_WEEK%, %FIRST_NAME%, or the upper case version of any field available on the Twitter User resource enclosed in % symbols (e.g. %SCREEN_NAME%).

##Prerequisites Twitter App Account

See Twitter Apps for instructions.

Node

See nodejs.org for instructions.

TypeScript

npm install -g typescript

##Setup Clone the repo.

git clone https://github.com/dev-mastery/msg-on-twitter-follow.git

Edit the included dotenv-sample.txt file and save it as .env in the cloned root directory ~\msg-on-twitter-follow. Your .env file should have the following structure (with your own info, of course):

T_MY_NAME = YourTwitterUsername
T_GREETING = default message to send when someone follows you
T_CONSUMER_KEY = Your Twitter API Consumer Key
T_CONSUMER_SECRET = Your Twitter API Consumer Secret
T_ACCESS_TOKEN = Your Twitter API Access Token
T_ACCESS_TOKEN_SECRET = Your Twitter API Access Token Secret

For more info on .env see dotenv

##Run Before running the following commands, please ensure you have all the prerequisites and that you have followed the setup instructions!

From the cloned directory:

tsc
npm install
npm start

twitBot API

twitBot~startMessagingNewFollowers([msg])

When a user follows you, follow them back and send a message

Kind: inner method of twitBot

Param Type Description
[msg] string the message to send. Defaults to the environment variable: process.env.T_GREETING. Can also use merge tags in the form, %FIELD_NAME% where FIELD_NAME is one of: DAY_OF_WEEK, FIRST_NAME, or the upper case form of any Twitter User field found at: https://dev.twitter.com/overview/api/users

twitBot~followUser(user)

Follows a user.

Kind: inner method of twitBot

Param Type Description
user Twit.Twitter.User the user to follow.

twitBot~sendMessage(user, [msg])

Sends a direct message (DM) to a user.

Kind: inner method of twitBot

Param Type Description
user Twit.Twitter.User the user to message
[msg] string the message to send. Defaults to the environment variable: process.env.T_GREETING. Can also use merge tags in the form, %FIELD_NAME%

twitBot~stopMessagingNewFollowers()

Stops tracking new followers

Kind: inner method of twitBot

##License Copyright (c) 2016 Dev Mastery

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

msg-on-twitter-follow's People

Contributors

arcdev1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.