Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bsdf/twitter
https://github.com/bsdf/twitter
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bsdf/twitter
- Owner: bsdf
- License: gpl-3.0
- Created: 2012-06-23T04:28:11.000Z (over 12 years ago)
- Default Branch: 1.1
- Last Pushed: 2014-06-11T23:23:12.000Z (over 10 years ago)
- Last Synced: 2024-06-19T04:10:58.399Z (6 months ago)
- Language: Go
- Size: 196 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](http://i.imgur.com/0V5yO.jpg)
`$ go get -u github.com/bsdf/twitter`
```go
package mainimport (
"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))
}
```