mirror of
https://github.com/arnaucube/argos.git
synced 2026-02-07 02:56:41 +01:00
exit script if connection to api is failed
This commit is contained in:
@@ -29,7 +29,8 @@ https://en.wikipedia.org/wiki/Panopticon
|
|||||||
3. Random follow
|
3. Random follow
|
||||||
- selects n number of accounts to follow, and follows n random accounts
|
- selects n number of accounts to follow, and follows n random accounts
|
||||||
4. Delete Tweets
|
4. Delete Tweets
|
||||||
5. Random tweet
|
5. Delete Favs (Likes)
|
||||||
|
6. Random tweet
|
||||||
- post a tweet with content from a selected account
|
- post a tweet with content from a selected account
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -89,11 +89,12 @@ func analyzeHours(tweets []twitter.Tweet) {
|
|||||||
for _, v := range tweets {
|
for _, v := range tweets {
|
||||||
time := strings.Split(v.CreatedAt, " ")[3]
|
time := strings.Split(v.CreatedAt, " ")[3]
|
||||||
hour := strings.Split(time, ":")[0]
|
hour := strings.Split(time, ":")[0]
|
||||||
if _, ok := hours[hour]; ok {
|
/*if _, ok := hours[hour]; ok {
|
||||||
hours[hour] = hours[hour] + 1
|
hours[hour] = hours[hour] + 1
|
||||||
} else {
|
} else {
|
||||||
hours[hour] = 1
|
hours[hour] = 1
|
||||||
}
|
}*/
|
||||||
|
hours[hour]++
|
||||||
}
|
}
|
||||||
printHours(hours)
|
printHours(hours)
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
build/argos
BIN
build/argos
Binary file not shown.
7
main.go
7
main.go
@@ -18,6 +18,7 @@ func main() {
|
|||||||
fmt.Println("---------------")
|
fmt.Println("---------------")
|
||||||
c.Cyan("argos initialized")
|
c.Cyan("argos initialized")
|
||||||
c.Purple("https://github.com/arnaucode/argos")
|
c.Purple("https://github.com/arnaucode/argos")
|
||||||
|
c.Purple("http://arnaucode/argos")
|
||||||
fmt.Println("version " + version)
|
fmt.Println("version " + version)
|
||||||
fmt.Println("Reading twitterConfig.json file")
|
fmt.Println("Reading twitterConfig.json file")
|
||||||
client := readConfigTokensAndConnect()
|
client := readConfigTokensAndConnect()
|
||||||
@@ -26,6 +27,10 @@ func main() {
|
|||||||
fmt.Println("Getting user data...")
|
fmt.Println("Getting user data...")
|
||||||
user := getUserData(client)
|
user := getUserData(client)
|
||||||
printUserData(user)
|
printUserData(user)
|
||||||
|
if user.ScreenName == "" {
|
||||||
|
c.Red("Can not connect to Twitter API, maybe the file twitterConfig.json is wrong")
|
||||||
|
os.Exit(3)
|
||||||
|
}
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
|
|
||||||
newcommand := bufio.NewReader(os.Stdin)
|
newcommand := bufio.NewReader(os.Stdin)
|
||||||
@@ -49,6 +54,8 @@ option to select: `
|
|||||||
case "1":
|
case "1":
|
||||||
fmt.Println("selected 1 - Analyze username")
|
fmt.Println("selected 1 - Analyze username")
|
||||||
optionAnalyzeUserTweets(client)
|
optionAnalyzeUserTweets(client)
|
||||||
|
fmt.Println("")
|
||||||
|
c.Purple("Note: the current hours displaying, are the Twitter servers hours (Coordinated Universal Time (UTC) +0000 UTC)")
|
||||||
break
|
break
|
||||||
case "2":
|
case "2":
|
||||||
fmt.Println("selected 2 - Unfollow all")
|
fmt.Println("selected 2 - Unfollow all")
|
||||||
|
|||||||
Reference in New Issue
Block a user