diff --git a/.gitignore b/.gitignore index 00032bd..da8975f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ _cgo_export.* _testmain.go -*.exe *.test *.prof diff --git a/README.md b/README.md index 9ed23af..c4bb43b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Be half bot and half human, a new generation of cyborgs The user analyzer features are insipired on the Python tweets_analyzer by x0rz https://github.com/x0rz/tweets_analyzer +#### [Disclamer] +This software was made to learn the Go syntax, it works, but the implementation is not in the optimal way. I don't have time to maintain it. + #### Argos Panoptes https://en.wikipedia.org/wiki/Argus_Panoptes @@ -15,7 +18,6 @@ https://en.wikipedia.org/wiki/Panopticon ![Argos](https://raw.githubusercontent.com/arnaucode/argos/master/argos.jpg "argos") -[under development] #### Current features 1. User analyzer diff --git a/argos b/argos index dc1e525..ea95670 100755 Binary files a/argos and b/argos differ diff --git a/build/argos b/build/argos index dc1e525..ea95670 100755 Binary files a/build/argos and b/build/argos differ diff --git a/build/argos.exe b/build/argos.exe new file mode 100755 index 0000000..3fee105 Binary files /dev/null and b/build/argos.exe differ diff --git a/optionAnalyzeTweet.go b/optionAnalyzeTweet.go index a4d936a..14c1ba0 100644 --- a/optionAnalyzeTweet.go +++ b/optionAnalyzeTweet.go @@ -7,6 +7,7 @@ import ( "sort" "strconv" "strings" + "time" "github.com/dghubble/go-twitter/twitter" ) @@ -28,7 +29,11 @@ func printDateRT(v DateRT) { fmt.Print("\x1b[0m") //defaultColor fmt.Print(" (ID: ") fmt.Print("\x1b[31;1m" + retweet.User.IDStr + "\x1b[0m)") - fmt.Print(", source: \x1b[33;1m" + source + "\x1b[0m") + if source == "TweetDeck" { + fmt.Print(", source: \x1b[33;1m" + source + "\x1b[0m") + } else { + fmt.Print(", source: " + source) + } fmt.Print(", user created at: \x1b[32;1m" + retweet.User.CreatedAt + "\x1b[0m,") fmt.Print(" \x1b[34;1m" + strconv.Itoa(retweet.User.FollowersCount) + "\x1b[0m followers") @@ -68,12 +73,16 @@ func optionAnalyzeTweet(client *twitter.Client) { var dates = make(map[string]DateRT) for _, retweet := range retweets { - retws := dates[retweet.CreatedAt].Retweets + createdat, err := retweet.CreatedAtTime() + check(err) + createdatRounded := time.Date(createdat.Year(), createdat.Month(), createdat.Day(), createdat.Hour(), createdat.Minute(), 0, 0, createdat.Location()) + + retws := dates[createdatRounded.String()].Retweets retws = append(retws, retweet) var currDate DateRT currDate.Retweets = retws - currDate.Date = retweet.CreatedAt - dates[retweet.CreatedAt] = currDate + currDate.Date = createdatRounded.String() + dates[createdatRounded.String()] = currDate } fmt.Println("total of " + strconv.Itoa(len(retweets)) + " retweets") diff --git a/twitterConfig_DEMO.json b/twitterConfig_DEMO.json new file mode 100644 index 0000000..fa82368 --- /dev/null +++ b/twitterConfig_DEMO.json @@ -0,0 +1,6 @@ +{ + "consumer_key": "xxxxxxxxxxxxxxxx", + "consumer_secret": "xxxxxxxxxxxxxxxx", + "access_token_key": "xxxxxxxxxxxxxxxx", + "access_token_secret": "xxxxxxxxxxxxxxxx" +}