some clean up

added Makefile
This commit is contained in:
Mahmoud Rahbar Azad 2018-10-25 21:18:45 +02:00
parent 8f1463b2ef
commit 5d5c779b43
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 7DBBD39E2BFEB784
8 changed files with 98 additions and 43 deletions

View file

@ -67,16 +67,15 @@ func (c *Crawler) Print(servers []hetzner.Server) {
c.tabWriter.Flush()
}
func (c *Crawler) isFiltered(server hetzner.Server) bool {
filtered := true
priceParsed := server.ParsePrice()
if server.Cpu_benchmark >= c.minBenchmark && server.Cpu_benchmark <= c.maxBenchmark &&
if server.CpuBenchmark >= c.minBenchmark && server.CpuBenchmark <= c.maxBenchmark &&
priceParsed >= c.minPrice && priceParsed <= c.maxPrice &&
server.Ram >= c.minRam && server.Ram <= c.maxRam &&
server.TotalHdd() >= c.minHddSize && server.TotalHdd() <= c.maxHddSize &&
server.Hdd_count >= c.minHddCount && server.Hdd_count <= c.maxHddCount {
server.HddCount >= c.minHddCount && server.HddCount <= c.maxHddCount {
filtered = false
}