arnaucube
arnaucube/twitterDM-to-matrixPublic Self-hosted repository
twitterDM-to-matrix/twitterUserOperations.go
twitterUserOperations.goRaw
 1package main
 2
 3import (
 4	"fmt"
 5
 6	"github.com/dghubble/go-twitter/twitter"
 7)
 8
 9func getUserData(client *twitter.Client) *twitter.User {
10	// Verify Credentials
11	verifyParams := &twitter.AccountVerifyParams{
12		SkipStatus:   twitter.Bool(true),
13		IncludeEmail: twitter.Bool(true),
14	}
15	user, _, _ := client.Accounts.VerifyCredentials(verifyParams)
16	return user
17}
18func printTwitterUserData(user *twitter.User) {
19	fmt.Print("username: ")
20	c.Cyan(user.Name + " @" + user.ScreenName)
21	if user.Email != "" {
22		fmt.Print("Email ")
23		c.Red(user.Email)
24	}
25	if user.Location != "" {
26		fmt.Print("Location: ")
27		c.Red(user.Location)
28	}
29	fmt.Print("user created on: ")
30	c.Cyan(user.CreatedAt)
31}