resource-twitter

for interacting with the Twitter API

npm install resource-twitter
4 downloads in the last week
8 downloads in the last month

twitter

for interacting with the Twitter API

API

properties

methods

properties

for interacting with the Twitter API

  • id

    • type : any
  • credentials

    • description : credentials for logging into twitter

    • properties

      • type : object

      • consumer_key

        • type : string

        • required : true

      • consumer_secret

        • type : string

        • required : true

      • access_token_key

        • type : string

        • required : true

      • access_token_secret

        • type : string

        • required : true

  • user

    • description : a twitter user

    • properties

      • id

        • required : false
      • screenName

        • type : string

        • required : false

  • tweet

    • description : a twitter tweet

    • type : object

    • properties

      • message

        • type : string

        • required : true

  • stream

    • description : a twitter stream

    • properties

      • method

        • type : string

        • required : true

      • follow

        • type : string

        • required : false

      • track

        • type : string

        • required : false

      • locations

        • type : string

        • required : false

methods

twitter.connect(options, callback)

connects to twitter

  • options

    • description : credentials for logging into twitter

    • properties

      • type : object

      • consumer_key

        • type : string

        • required : true

      • consumer_secret

        • type : string

        • required : true

      • access_token_key

        • type : string

        • required : true

      • access_token_secret

        • type : string

        • required : true

  • callback

    • type : function

    • default : function () {}

twitter.disconnect(options, callback)

disconnects from twitter

  • options

    • type : object

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

  • callback

    • type : function

    • default : function () {}

twitter.addStream(options, callback)

starts listening to a twitter stream

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • stream

        • description : a twitter stream

        • properties

          • method

            • type : string

            • required : true

          • follow

            • type : string

            • required : false

          • track

            • type : string

            • required : false

          • locations

            • type : string

            • required : false

  • callback

    • type : function

    • default : function (error, options, stream) {}

twitter.getStream(options, callback)

gets an active twitter stream

  • options

    • type : object

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • streamId

        • type : string
  • callback

    • type : function

twitter.removeStream(object, callback)

stops listening to a twitter stream

  • object

    • type : object

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • streamId

        • type : string
  • callback

    • type : function

    • default : function (error, options) {}

twitter.limit(options, callback)

collects rate limiting events from twitter

  • options

    • type : object
  • callback

    • type : function

    • default : function () {}

twitter.error(error, callback)

collects error events from twitter

  • error

  • callback

    • type : function

    • default : function () {}

twitter.send(options, callback)

sends a tweet (updates your status)

  • options

    • type : object

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • message

        • type : string

        • required : true

  • callback

    • default : function () {
      resource.logger.info('sent tweet: ');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.info(i + ': ' + arg);
      });
      
      }

twitter.receive(options, callback)

receives tweets from activated streams

  • options

    • description : a twitter tweet

    • type : object

    • properties

      • message

        • type : string

        • required : true

  • callback

    • default : function () {
      resource.logger.info('received tweet: ');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.info(i + ': ' + arg);
      });
      
      }

twitter.follow(options, callback)

follows a twitter user

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • screenName

        • type : string

        • required : false

      • id

        • required : false
  • callback

    • type : function

    • default : function () {

      resource.logger.info('followed: ');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.info(i + ': ' + arg);
      });
      

      }

twitter.unfollow(options, callback)

unfollows a twitter user

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • screenName

        • type : string

        • required : false

      • id

        • required : false
  • callback

    • type : function

    • default : function () {

      resource.logger.info('unfollowed: ');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.info(i + ': ' + arg);
      });
      

      }

twitter.block(options, callback)

blocks a twitter user

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • screenName

        • type : string

        • required : false

      • id

        • required : false
  • callback

    • type : function

    • default : function () {

      resource.logger.info('blocked: ');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.info(i + ': ' + arg);
      });
      

      }

twitter.report(options, callback)

reports a twitter user

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • screenName

        • type : string

        • required : false

      • id

        • required : false
  • callback

    • type : function

    • default : function () {

      resource.logger.warn('reported:');
      [].slice.call(arguments).forEach(function (arg, i) {
        resource.logger.warn(i + ': ' + arg);
      });
      

      }

twitter.showUser(options, callback)

shows information on a twitter user

  • options

    • properties

      • user

        • description : a twitter user

        • properties

          • id

            • required : false
          • screenName

            • type : string

            • required : false

      • screenName

        • type : string

        • required : false

      • id

        • required : false
  • callback

    • type : function

twitter.tweetLength(options, callback)

gets the length of a tweet

  • options

    • description : a twitter tweet

    • type : object

    • properties

      • message

        • type : string

        • required : true

  • callback

    • type : function

    • required : false

dependencies

README auto-generated with docs

npm loves you