From dfcf52f30cdbde3a4e1400024b0c27451d179e5d Mon Sep 17 00:00:00 2001 From: s Date: Sat, 8 Nov 2025 02:44:13 -0500 Subject: feat: add unauthenticated client support and new osint/x commands --- cmd/x.go | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'cmd/x.go') diff --git a/cmd/x.go b/cmd/x.go index c88243b..d0d3209 100644 --- a/cmd/x.go +++ b/cmd/x.go @@ -32,10 +32,28 @@ var xTweetsCmd = &cobra.Command{ RunE: runXTweetsSearch, } +var xFirstCmd = &cobra.Command{ + Use: "first [username]", + Short: "Get first 20 followers of a Twitter/X account", + Long: `Retrieves the first 20 followers of a Twitter/X account`, + Args: cobra.ExactArgs(1), + RunE: runXFirstFollowers, +} + +var xNFLCmd = &cobra.Command{ + Use: "nfl [username]", + Short: "Get notable followers of a Twitter/X account", + Long: `Retrieves the notable followers (influential accounts) following a Twitter/X account`, + Args: cobra.ExactArgs(1), + RunE: runXNotableFollowers, +} + func init() { rootCmd.AddCommand(xCmd) xCmd.AddCommand(xHistoryCmd) xCmd.AddCommand(xTweetsCmd) + xCmd.AddCommand(xFirstCmd) + xCmd.AddCommand(xNFLCmd) } func runXHistorySearch(cmd *cobra.Command, args []string) error { @@ -72,7 +90,7 @@ func runXHistorySearch(cmd *cobra.Command, args []string) error { func runXTweetsSearch(cmd *cobra.Command, args []string) error { cfg := config.New() - c, err := client.New(cfg) + c, err := client.NewUnauthenticated(cfg) if err != nil { return err } @@ -88,3 +106,37 @@ func runXTweetsSearch(cmd *cobra.Command, args []string) error { return nil } + +func runXFirstFollowers(cmd *cobra.Command, args []string) error { + apiKey, _ := cmd.Flags().GetString("api-key") + cfg := config.New().WithAPIKey(apiKey) + + c, err := client.New(cfg) + if err != nil { + return err + } + + response, err := c.GetFirstFollowers(args[0]) + if err != nil { + return err + } + + return utils.PrintJSON(response) +} + +func runXNotableFollowers(cmd *cobra.Command, args []string) error { + apiKey, _ := cmd.Flags().GetString("api-key") + cfg := config.New().WithAPIKey(apiKey) + + c, err := client.New(cfg) + if err != nil { + return err + } + + response, err := c.GetNotableFollowers(args[0]) + if err != nil { + return err + } + + return utils.PrintJSON(response) +} -- cgit v1.2.3