Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

anaconda "."
"github.com/ChimeraCoder/anaconda"
)

// Initialize an client library for a given user.
Expand Down
2 changes: 1 addition & 1 deletion oembed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

anaconda "."
"github.com/ChimeraCoder/anaconda"
)

func TestOEmbed(t *testing.T) {
Expand Down
13 changes: 13 additions & 0 deletions streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ const (

// messages

type DirectMessageDeletionNotice struct {
Id int64 `json:"id"`
IdStr string `json:"id_str"`
UserId int64 `json:"user_id"`
}
type directMessageDeletionNotice struct {
Delete *struct {
DirectMessage *DirectMessageDeletionNotice `json:"direct_message"`
} `json:"delete"`
}

type StatusDeletionNotice struct {
Id int64 `json:"id"`
IdStr string `json:"id_str"`
Expand Down Expand Up @@ -171,6 +182,8 @@ func jsonToKnownType(j []byte) interface{} {
// TODO: DRY
if o := new(Tweet); jsonAsStruct(j, "/source", &o) {
return *o
} else if o := new(directMessageDeletionNotice); jsonAsStruct(j, "/delete/direct_message", &o) {
return *o.Delete.DirectMessage
} else if o := new(statusDeletionNotice); jsonAsStruct(j, "/delete", &o) {
return *o.Delete.Status
} else if o := new(locationDeletionNotice); jsonAsStruct(j, "/scrub_geo", &o) {
Expand Down
1 change: 1 addition & 0 deletions tweet.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Tweet struct {
Lang string `json:"lang"`
Place Place `json:"place"`
PossiblySensitive bool `json:"possibly_sensitive"`
QuotedStatus *Tweet `json:"quoted_status"`
RetweetCount int `json:"retweet_count"`
Retweeted bool `json:"retweeted"`
RetweetedStatus *Tweet `json:"retweeted_status"`
Expand Down
11 changes: 5 additions & 6 deletions twitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"testing"
"time"

anaconda "."
"github.com/ChimeraCoder/anaconda"
)

var CONSUMER_KEY = os.Getenv("CONSUMER_KEY")
Expand Down Expand Up @@ -201,10 +201,9 @@ func Test_GetTweet(t *testing.T) {
expectedEntities := anaconda.Entities{Hashtags: []struct {
Indices []int
Text string
}{struct {
Indices []int
Text string
}{Indices: []int{86, 93}, Text: "golang"}}, Urls: []struct {
}{

{Indices: []int{86, 93}, Text: "golang"}}, Urls: []struct {
Indices []int
Url string
Display_url string
Expand All @@ -215,7 +214,7 @@ func Test_GetTweet(t *testing.T) {
Screen_name string
Id int64
Id_str string
}{}, Media: []anaconda.EntityMedia{anaconda.EntityMedia{
}{}, Media: []anaconda.EntityMedia{{
Id: 303777106628841472,
Id_str: "303777106628841472",
Media_url: "http://pbs.twimg.com/media/BDc7q0OCEAAoe2C.jpg",
Expand Down