Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Reorganized the documentation
  • Loading branch information
cmlight authored Mar 5, 2019
1 parent cc42365 commit 8e13b74
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,10 @@ If not already installed, download and install the Go distribution from https://

## Running sample app

To run the crawl sample app against an internal sample web server simulating an app listing page HTML file (`sample_app_store.html`), specify the desired port using the `--sample_file_server_port` flag. The app will crawl the app store URL, output the parse results, and then immediately terminate.
The sample app can be run against any compliant app store URL. For example, this command line demonstrates crawling an app in Google Play Store.

```
cd examples/appadstxtcrawl
go run sample_app.go --app_store_url=http://localhost:8081/sample_app_store.html --sample_file_server_port=8081
```

Sample output:

```
Parsed metadata:
Developer URL: https://sample.path.to/page
Bundle ID: com.example.myapp
Store ID: SKU12345
Derived app-ads.txt URLs:
Registerable Domain URL: https://path.to/app-ads.txt
Subdomain URL: https://sample.path.to/app-ads.txt
```

The app can be run against any other app store URL desired. For example, this command line demonstrates crawling an app in Google Play Store.

```
cd examples/appadstxtcrawl
go run sample_app.go --app_store_url=https://play.google.com/store/apps/details?id=com.google.android.apps.maps
go run examples/appadstxtcrawl/sample_app.go --app_store_url=https://play.google.com/store/apps/details?id=com.google.android.apps.maps
```

Sample output:
Expand All @@ -56,6 +35,8 @@ Derived app-ads.txt URLs:
```

If the script receives a response other than HTTP 200 from the web server, it will terminate with an error message.

Note: if the app store URL does not provide the required HTML meta tags, the
script will display an empty result such as the following:

Expand All @@ -67,3 +48,25 @@ Parsed metadata:
No developer URL found to parse.
```

## Using a local store HTML page

To run the crawl sample app against an internal sample web server simulating an app listing page HTML file (`sample_app_store.html`), specify the desired port using the `--sample_file_server_port` flag. The app will crawl the app store URL, output the parse results, and then immediately terminate. Note: the web server will look for files relative to your shell's current path, so change directory to the local HTML file location prior to running.

```
cd examples/appadstxtcrawl
go run sample_app.go --app_store_url=http://localhost:8081/sample_app_store.html --sample_file_server_port=8081
```

Sample output:

```
Parsed metadata:
Developer URL: https://sample.path.to/page
Bundle ID: com.example.myapp
Store ID: SKU12345
Derived app-ads.txt URLs:
Registerable Domain URL: https://path.to/app-ads.txt
Subdomain URL: https://sample.path.to/app-ads.txt
```

0 comments on commit 8e13b74

Please sign in to comment.