Browse Source

improved user analysis

master
arnaucode 7 years ago
parent
commit
1b7865d715
2 changed files with 37 additions and 0 deletions
  1. +36
    -0
      analyzeUserAccount.go
  2. +1
    -0
      optionAnalyzeUserTweets.go

+ 36
- 0
analyzeUserAccount.go

@ -0,0 +1,36 @@
package main
import (
"fmt"
"strconv"
"github.com/dghubble/go-twitter/twitter"
)
func analyzeUserAccount(client *twitter.Client, username string) {
user, _, err := client.Users.Show(&twitter.UserShowParams{
ScreenName: username,
})
if err != nil {
fmt.Println(err)
}
fmt.Print("User created at: ")
c.Cyan(user.CreatedAt)
fmt.Print("email: ")
c.Cyan(user.Email)
fmt.Print("Following count: ")
c.Cyan(strconv.Itoa(user.FriendsCount))
fmt.Print("Followers count: ")
c.Cyan(strconv.Itoa(user.FollowersCount))
fmt.Print("Location: ")
c.Cyan(user.Location)
fmt.Print("Timezone: ")
c.Cyan(user.Timezone)
fmt.Println("")
fmt.Println("")
}

+ 1
- 0
optionAnalyzeUserTweets.go

@ -62,5 +62,6 @@ func optionAnalyzeUserTweets(client *twitter.Client) {
fmt.Println(" ")
fmt.Print("User @")
c.Cyan(username)
analyzeUserAccount(client, username)
fmt.Println(" analysis finished")
}

Loading…
Cancel
Save