Skip to content

Commit

Permalink
Don't search for empty games
Browse files Browse the repository at this point in the history
  • Loading branch information
boppreh committed May 4, 2014
1 parent 17c556b commit ca71de5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions steamgrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ const googleSearchFormat = `https://ajax.googleapis.com/ajax/services/search/ima
// Returns the first steam grid image URL found by Google search of a given
// game name.
func getGoogleImage(gameName string) (string, error) {
if gameName == "" {
return "", nil
}

url := googleSearchFormat + url.QueryEscape("steam grid OR header"+gameName)
response, err := http.Get(url)
if err != nil {
Expand Down

0 comments on commit ca71de5

Please sign in to comment.