mirror of
https://code.dnix.de/da/flokatirc
synced 2026-07-27 08:39:45 +02:00
Added module configuration params: -params=<key>:<val>(!<key>:<val>])*
This commit is contained in:
+24
-24
@@ -47,7 +47,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
msgHandlers["sc"] = scHandleMessage
|
||||
MsgHandlers["sc"] = scHandleMessage
|
||||
log.Println("Initializing sc module")
|
||||
go scScrapeLoop()
|
||||
}
|
||||
@@ -111,13 +111,13 @@ func scScraper() {
|
||||
nextFunds := ((funds / FUNDS_INT) * FUNDS_INT) + FUNDS_INT
|
||||
|
||||
if curFans >= nextFans {
|
||||
sayCh <- "*\n[SC] Star Citizens: " + util.NumberToString(curFans, '.')
|
||||
SayCh <- "*\n[SC] Star Citizens: " + util.NumberToString(curFans, '.')
|
||||
}
|
||||
if curFleet >= nextFleet {
|
||||
sayCh <- "*\n[SC] The UEE Fleet: " + util.NumberToString(curFleet, '.')
|
||||
SayCh <- "*\n[SC] The UEE Fleet: " + util.NumberToString(curFleet, '.')
|
||||
}
|
||||
if curFunds >= nextFunds {
|
||||
sayCh <- "*\n[SC] Funds raised: " + util.NumberToString(curFunds, '.')
|
||||
SayCh <- "*\n[SC] Funds raised: " + util.NumberToString(curFunds, '.')
|
||||
}
|
||||
|
||||
fans = curFans
|
||||
@@ -126,10 +126,10 @@ func scScraper() {
|
||||
}
|
||||
|
||||
func showScStats() {
|
||||
sayCh <- "*\n*** SC User and Funding Stats ***"
|
||||
sayCh <- fmt.Sprintf("*\nFans: %s", util.NumberToString(fans, '.'))
|
||||
sayCh <- fmt.Sprintf("*\nFleet: %s", util.NumberToString(fleet, '.'))
|
||||
sayCh <- fmt.Sprintf("*\nFunds: $ %s", util.NumberToString(funds, '.'))
|
||||
SayCh <- "*\n*** SC User and Funding Stats ***"
|
||||
SayCh <- fmt.Sprintf("*\nFans: %s", util.NumberToString(fans, '.'))
|
||||
SayCh <- fmt.Sprintf("*\nFleet: %s", util.NumberToString(fleet, '.'))
|
||||
SayCh <- fmt.Sprintf("*\nFunds: $ %s", util.NumberToString(funds, '.'))
|
||||
}
|
||||
|
||||
func showCitizen(handle string) {
|
||||
@@ -157,18 +157,18 @@ func showCitizen(handle string) {
|
||||
sid := reSid.FindStringSubmatch(string(body))
|
||||
rank := reRank.FindStringSubmatch(string(body))
|
||||
if len(name) > 1 {
|
||||
sayCh <- "*\n*** Citizen Info ***"
|
||||
sayCh <- "*\n" + "Name: " + html.UnescapeString(string(name[1])) + " [" + string(handle_[1]) + "]"
|
||||
sayCh <- "*\n" + "URL: " + QUERY_CIT_URL + string(handle_[1])
|
||||
sayCh <- "*\n" + "UEE #: " + string(record[1])
|
||||
SayCh <- "*\n*** Citizen Info ***"
|
||||
SayCh <- "*\n" + "Name: " + html.UnescapeString(string(name[1])) + " [" + string(handle_[1]) + "]"
|
||||
SayCh <- "*\n" + "URL: " + QUERY_CIT_URL + string(handle_[1])
|
||||
SayCh <- "*\n" + "UEE #: " + string(record[1])
|
||||
if len(org) > 1 {
|
||||
sayCh <- "*\n" + "Organization: " + html.UnescapeString(string(org[1])) + " [" + string(sid[1]) + "]"
|
||||
sayCh <- "*\n" + "Rank: " + html.UnescapeString(string(rank[1]))
|
||||
SayCh <- "*\n" + "Organization: " + html.UnescapeString(string(org[1])) + " [" + string(sid[1]) + "]"
|
||||
SayCh <- "*\n" + "Rank: " + html.UnescapeString(string(rank[1]))
|
||||
} else {
|
||||
sayCh <- "*\n" + "Organization: <none>"
|
||||
SayCh <- "*\n" + "Organization: <none>"
|
||||
}
|
||||
} else {
|
||||
sayCh <- "*\n" + "*** No Such Citizen ***"
|
||||
SayCh <- "*\n" + "*** No Such Citizen ***"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,14 +195,14 @@ func showOrganization(handle string) {
|
||||
focus := reFocus.FindStringSubmatch(string(body))
|
||||
comm := reComm.FindStringSubmatch(string(body))
|
||||
if len(name) > 1 {
|
||||
sayCh <- "*\n*** Organization Info ***"
|
||||
sayCh <- "*\nName: " + string(name[1]) + " [" + strings.ToUpper(handle) + "]"
|
||||
sayCh <- "*\nURL: " + QUERY_ORG_URL + strings.ToUpper(handle)
|
||||
sayCh <- "*\nMembers: " + string(count[1])
|
||||
sayCh <- "*\nModel: " + string(model[1])
|
||||
sayCh <- "*\nCommitment: " + string(comm[1])
|
||||
sayCh <- "*\nFocus: " + string(focus[1]) + ", " + string(focus[2])
|
||||
SayCh <- "*\n*** Organization Info ***"
|
||||
SayCh <- "*\nName: " + string(name[1]) + " [" + strings.ToUpper(handle) + "]"
|
||||
SayCh <- "*\nURL: " + QUERY_ORG_URL + strings.ToUpper(handle)
|
||||
SayCh <- "*\nMembers: " + string(count[1])
|
||||
SayCh <- "*\nModel: " + string(model[1])
|
||||
SayCh <- "*\nCommitment: " + string(comm[1])
|
||||
SayCh <- "*\nFocus: " + string(focus[1]) + ", " + string(focus[2])
|
||||
} else {
|
||||
sayCh <- "*\n*** No Such Organization ***"
|
||||
SayCh <- "*\n*** No Such Organization ***"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user