gotwit

package
v0.0.0-...-f43d3ad Latest Latest
Warning

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

Go to latest
Published: May 30, 2015 License: MIT, MIT Imports: 4 Imported by: 0

README

gotwit

A library for creating twitter bots.

Getting Started

Copy the files from template/ to a new project.

Rename secret.example.json to secrets.json and fill in the tokens with your bot's API tokens.

Running on Heroku

Install Godep:

$ go get github.com/tools/godep

Freeze the dependencies:

$ godep save

Add a Procfile containing the following:

worker: <project-name>

Commit everything:

$ git init
$ git add .
$ git commit -m "Initial commit."

Now you're ready to push to Heroku.

Create a Heroku instance:

$ heroku create -b https://github.com/heroku/heroku-buildpack-go.git <project-name>

Set up the environment:

$ heroku config:set \
    GOTWIT_CONSUMER_KEY=<consumer-key> \
    GOTWIT_CONSUMER_SECRET=<consumer-secret> \
    GOTWIT_ACCESS_TOKEN=<access-token> \
    GOTWIT_ACCESS_TOKEN_SECRET=<access-token-secret>

Now you're ready to go. Push it live:

$ git push heroku master

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func NewBot

func NewBot(screenName string, consumerConfig twitter.ConsumerConfig, accessConfig twitter.AccessConfig) Bot

func (*Bot) Post

func (b *Bot) Post(message string, nsfw bool) error

func (*Bot) RegisterCallback

func (b *Bot) RegisterCallback(t callback.Type, cb callback.Callback) (id int)

func (*Bot) Reply

func (b *Bot) Reply(tweet anaconda.Tweet, message string, nsfw bool) error

func (*Bot) ScreenName

func (b *Bot) ScreenName() string

func (*Bot) Start

func (b *Bot) Start() error

func (*Bot) Stop

func (b *Bot) Stop() error

func (*Bot) UnregisterCallback

func (b *Bot) UnregisterCallback(t callback.Type, id int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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