Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bsdf/twitter


https://github.com/bsdf/twitter

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

![](http://i.imgur.com/0V5yO.jpg)

`$ go get -u github.com/bsdf/twitter`

```go
package main

import (
"github.com/bsdf/twitter"
"fmt"
"strings"
)

func main() {
t := twitter.Twitter{
ConsumerKey: "CONSUMER_KEY_HERE",
ConsumerSecret: "CONSUMER_SECRET_HERE",
OAuthToken: "OAUTH_TOKEN_HERE",
OAuthTokenSecret: "OAUTH_TOKEN_SECRET_HERE",
}

_, err := t.Tweet("RT @bsdf M83 Designs Children's Sneakers")
if err != nil {
fmt.Println(err.Error())
return
}

me, err := t.Follow("bsdf")
if err != nil {
fmt.Println("Couldn't follow @bsdf ):", err.Error())
return
}

fmt.Println("@bsdf currently goes by", me.Name)

tos, err := t.GetTOS()
if err != nil {
fmt.Println(err.Error())
return
}

fmt.Println(strings.Replace(tos, "Terms", "Turds", -1))
}
```