Last active
August 29, 2015 13:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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