arnaucube
arnaucube/argosPublic Self-hosted repository
argos/main.go
main.goRaw
 1package main
 2
 3import (
 4	"bufio"
 5	"fmt"
 6	"os"
 7	"strings"
 8)
 9
10const version = "0.1-dev"
11const minNumWords = 10
12const minNumHashtag = 2
13const iterationsCount = 3
14
15func main() {
16	c.DarkGray("Argus Panoptes")
17	fmt.Println("---------------")
18	c.Cyan("argus initialized")
19	c.Purple("https://github.com/arnaucode/argus")
20	fmt.Println("version " + version)
21	fmt.Println("Reading twitterConfig.json file")
22	client := readConfigTokensAndConnect()
23	fmt.Println("---------------")
24	newcommand := bufio.NewReader(os.Stdin)
25	fmt.Print("Please select command number")
26	options := `
27	1 - Analyze username
28	2 - Delete Tweets
29	0 - Exit script
30option to select: `
31	for {
32		fmt.Print(options)
33
34		option, _ := newcommand.ReadString('\n')
35		option = strings.TrimSpace(option)
36
37		switch option {
38		case "1":
39			fmt.Println("selected 1 - Analyze username")
40			getUserTweets(client)
41			break
42		case "2":
43			fmt.Println("selected 2 - Delete Tweets")
44			deleteTweetsAndFavs(client)
45			break
46		case "0":
47			fmt.Println("selected 0 - exit script")
48			os.Exit(3)
49			break
50		default:
51			fmt.Println("Invalid option")
52			break
53		}
54	}
55}