You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
677 B

package main
import (
"fmt"
"github.com/dghubble/go-twitter/twitter"
)
func getUserData(client *twitter.Client) *twitter.User {
// Verify Credentials
verifyParams := &twitter.AccountVerifyParams{
SkipStatus: twitter.Bool(true),
IncludeEmail: twitter.Bool(true),
}
user, _, _ := client.Accounts.VerifyCredentials(verifyParams)
return user
}
func printTwitterUserData(user *twitter.User) {
fmt.Print("username: ")
c.Cyan(user.Name + " @" + user.ScreenName)
if user.Email != "" {
fmt.Print("Email ")
c.Red(user.Email)
}
if user.Location != "" {
fmt.Print("Location: ")
c.Red(user.Location)
}
fmt.Print("user created on: ")
c.Cyan(user.CreatedAt)
}