twi-list-slack

command module
v0.0.0-...-ad18335 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2015 License: MIT Imports: 10 Imported by: 0

README

twi-list-slack

Description

twitter list send to slack for golang

Demo

demo

Usage

config

Multiple slack channel support.

$ twi-list-slack config --filePath config.json

config.json is sample

{
  "twitter": {
    "consumerKey": "xxxxxxxxxxxxxxxxxxxxx",
    "consumerSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "accessToken": "xxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxx",
    "accessTokenSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "filters": [
    {
      "channelName": "#twitter",
      "incomingURL": "https://hooks.slack.com/services/xxxxxxxxxx/xxxxxxxxxxxxxxxxx/xxxxxxxxxxxxx"
    },
    {
      "channelName": "#random",
      "incomingURL": "https://hooks.slack.com/services/xxxxxx/xxxx/xxxxxx",
      "list_id": "111111111"
    }
  ]
}
environment variables
# Twitter OAuth
export TWLS_CONSUMER_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export TWLS_CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export TWLS_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export TWLS_ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Twitter Filter ListID
export TWLS_LIST_ID=123456789
# Slack incoming URL
export TWLS_INCOMING_URL=https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxxxxxx
$ twi-list-slack

imcoming URL:

imcoming1

imcoming2

Command line options
$ ./twi-list-slack --help
NAME:
   twi-list-slack -

USAGE:
   twi-list-slack [global options] command [command options] [arguments...]

VERSION:
   0.1.0

AUTHOR:
  kyokomi - <[email protected]>

COMMANDS:
   config, c
   help, h	Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --ck 		twitter Consumer key [$TWLS_CONSUMER_KEY]
   --cs 		twitter Consumer secret [$TWLS_CONSUMER_SECRET]
   --at 		twitter Access token [$TWLS_ACCESS_TOKEN]
   --ats 		twitter Access token secret [$TWLS_ACCESS_TOKEN_SECRET]
   --list-id 		the numerical id of the list [$TWLS_LIST_ID]
   --cn '#twitter'	slack channel name [$TWLS_SLACK_CHANNEL_NAME]
   --incomingURL 	slack incomingURL [$TWLS_INCOMING_URL]
   --help, -h		show help
   --version, -v	print the version

Install

To install, use go get:

$ go get github.com/kyokomi/twi-list-slack

Contribution

  1. Fork (https://github.com/kyokomi/twi-list-slack/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

Author

kyokomi

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/mrjones/oauth
OAuth 1.0 consumer implementation.
OAuth 1.0 consumer implementation.
_workspace/src/github.com/mrjones/oauth/examples/latitude
THIS NO LONGER WORKS!! Latitude is using OAuth 2.0 now.
THIS NO LONGER WORKS!! Latitude is using OAuth 2.0 now.
_workspace/src/github.com/mrjones/oauth/examples/netflix
go run examples/netflix/netflix.go --consumerkey <key> --consumersecret <secret> --appname <appname>
go run examples/netflix/netflix.go --consumerkey <key> --consumersecret <secret> --appname <appname>
_workspace/src/github.com/mrjones/oauth/examples/twitterserver
Similar to the twitter example, but using an HTTP server instead of the command line.
Similar to the twitter example, but using an HTTP server instead of the command line.
_workspace/src/github.com/ttacon/chalk
Package chalk is a package for styling terminal/console output.
Package chalk is a package for styling terminal/console output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL