diff --git a/README.md b/README.md index 6db310c..daab607 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ http://arnaucode.com/argos/ -# argos +# argos [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucode/argos)](https://goreportcard.com/report/github.com/arnaucode/argos) twitter analyzer written in Go lang, insipired on the Python tweets_analyzer by x0rz https://github.com/x0rz/tweets_analyzer #### Argos Panoptes @@ -21,10 +21,10 @@ https://en.wikipedia.org/wiki/Panopticon - Devices used - Hashtags most used count - Interactions with other users count -2. Delete Tweets -3. Unfollow all -4. Random follow +2. Unfollow all +3. Random follow - selects n number of accounts to follow, and follows n random accounts +4. Delete Tweets 5. Random tweet - post a tweet with content from a selected account diff --git a/analyzeDates.go b/analyzeDates.go index d981f41..8f75c9b 100644 --- a/analyzeDates.go +++ b/analyzeDates.go @@ -59,7 +59,6 @@ func printDays(days map[string]int) { func analyzeDays(tweets []twitter.Tweet) { var days = make(map[string]int) for _, v := range tweets { - //fmt.Println(v.CreatedAt) day := strings.Split(v.CreatedAt, " ")[0] if _, ok := days[day]; ok { days[day] = days[day] + 1 diff --git a/build/argos b/build/argos index 739e8d7..71de4ea 100755 Binary files a/build/argos and b/build/argos differ diff --git a/main.go b/main.go index e23c106..a5a4bd1 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ const version = "0.1-dev" const minNumWords = 10 const minNumHashtag = 2 const minNumUserInteractions = 1 -const iterationsCount = 1 +const iterationsCount = 3 func main() { c.Yellow("Argos Panoptes") diff --git a/optionDeleteTweets.go b/optionDeleteTweets.go index 53cfed9..7f4f8b4 100644 --- a/optionDeleteTweets.go +++ b/optionDeleteTweets.go @@ -39,7 +39,6 @@ func printUserData(user *twitter.User) { func deleteTweets(client *twitter.Client, user *twitter.User) { tweets := getTweets(client, user.ScreenName, iterationsCount) count := 0 - //fmt.Println(tweets) for _, v := range tweets { c.Red("deleting: [id: " + v.IDStr + "] " + v.Text) deleted, _, _ := client.Statuses.Destroy(v.ID, nil) diff --git a/optionFollowRandom.go b/optionFollowRandom.go index c5b36ac..06405b0 100644 --- a/optionFollowRandom.go +++ b/optionFollowRandom.go @@ -28,9 +28,8 @@ func getUserToFollowFromUser(client *twitter.Client, fromUser string) string { } if httpResp.Status != "200 OK" { c.Red(httpResp.Status) + c.Purple("maybe twitter has blocked the account, CTRL+C, wait 15 minutes and try again") } - //fmt.Println(friends.Users) - //c.Green("@" + friends.Users[0].ScreenName) return friends.Users[0].ScreenName } @@ -44,7 +43,6 @@ func followUser(client *twitter.Client, screenName string) { func followRandom(client *twitter.Client, nFollow int, screenName string) { fmt.Println("Starting to follow " + strconv.Itoa(nFollow) + " users") - //screenName := firstScreenName for i := 0; i < nFollow; i++ { userToFollow := getUserToFollowFromUser(client, screenName) followUser(client, userToFollow) diff --git a/optionTweetRandom.go b/optionTweetRandom.go index aae6689..7aaa6a0 100644 --- a/optionTweetRandom.go +++ b/optionTweetRandom.go @@ -17,6 +17,7 @@ func postTweet(client *twitter.Client, content string) { } if httpResp.Status != "200 OK" { c.Red("error: " + httpResp.Status) + c.Purple("maybe twitter has blocked the account, CTRL+C, wait 15 minutes and try again") } fmt.Print("tweet posted: ") c.Green(tweet.Text) diff --git a/optionUnfollowAll.go b/optionUnfollowAll.go index 0e21276..452d3bb 100644 --- a/optionUnfollowAll.go +++ b/optionUnfollowAll.go @@ -37,7 +37,6 @@ func getFollowingUsers(client *twitter.Client, user *twitter.User) { if httpResp.Status != "200 OK" { c.Red(httpResp.Status) } - //fmt.Println(following) for _, k := range following.Users { unfollowUser(client, k.ScreenName) //wait to avoid the twitter api limitation diff --git a/printSortedMapStringInt.go b/printSortedMapStringInt.go index 880b0d9..993cca6 100644 --- a/printSortedMapStringInt.go +++ b/printSortedMapStringInt.go @@ -22,7 +22,6 @@ func printSortedMapStringInt(m map[string]int, threshold int) map[int][]string { sort.Sort(sort.Reverse(sort.IntSlice(a))) for _, k := range a { for _, s := range n[k] { - //fmt.Printf("%d (%d)- %s,\n", k, tantPerCent, s) fmt.Println(strconv.Itoa(k) + " - " + s) } } diff --git a/readConfigTokensAndConnect.go b/readConfigTokensAndConnect.go index 8547318..aca0820 100644 --- a/readConfigTokensAndConnect.go +++ b/readConfigTokensAndConnect.go @@ -24,7 +24,6 @@ func readConfigTokensAndConnect() (client *twitter.Client) { } content := string(file) json.Unmarshal([]byte(content), &config) - //fmt.Printf("%+v\n", config) fmt.Println("twitterConfig.json read comlete") fmt.Print("connecting to twitter api --> ")