Skip to content

Commit

Permalink
Added printer for LocationsCommands.
Browse files Browse the repository at this point in the history
  • Loading branch information
gedex committed Aug 14, 2013
1 parent 97f0f11 commit dee7102
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions utils/printer.go
Expand Up @@ -113,3 +113,22 @@ func TagSlicePrinter(t []instagram.Tag, rp *instagram.ResponsePagination, s stri
fmt.Printf("\nGet next page by supplying: %s %v\n", s, rp.NextMaxID)
}
}

func LocationPrinter(l *instagram.Location) {
fmt.Printf("%-20s : %v\n", "ID", l.ID)
fmt.Printf("%-20s : %v\n", "Name", l.Name)
fmt.Printf("%-20s : %v\n", "Latitude", l.Latitude)
fmt.Printf("%-20s : %v\n", "Longitue", l.Longitude)
}

func LocationSlicePrinter(l []instagram.Location, rp *instagram.ResponsePagination, s string) {
for i, _l := range l {
LocationPrinter(&_l)
if i != len(l)-1 {
fmt.Println()
}
}
if rp != nil && rp.NextMaxID != "" {
fmt.Printf("\nGet next page by supplying: %s %v\n", s, rp.NextMaxID)
}
}

0 comments on commit dee7102

Please sign in to comment.