Skip to content

Instantly share code, notes, and snippets.

@pixyj
Last active August 29, 2015 13:57
Show Gist options
  • Save pixyj/9364787 to your computer and use it in GitHub Desktop.
Save pixyj/9364787 to your computer and use it in GitHub Desktop.
Simple Go program to check if your app is published yet on the Play Store
package main
import (
"fmt"
"net/http"
"time"
"os/exec"
)
func IsAppPublished(url string) bool {
fmt.Println("Searching for app")
resp, err := http.Get(url)
if err != nil {
if resp.StatusCode == 200 {
return true
}
}
fmt.Println("Not found!")
return false
}
func main() {
url := "https://play.google.com/store/apps/details?id=<YOUR_PACKAGE>"
for {
if IsAppPublished(url) {
fmt.Println("App published!")
cmd := exec.Command("google-chrome", url)
cmd.Run()
break
} else {
time.Sleep(6000 * time.Millisecond)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment