Added script to fetch devices from play-store-api

This commit is contained in:
Domenico Iezzi 2018-07-15 13:15:00 +02:00
parent 99ae4cba0e
commit 13bc63b927
No known key found for this signature in database
GPG Key ID: D8CE73FC9E4393C3
3 changed files with 1526 additions and 8 deletions

View File

@ -1,8 +1,13 @@
# Documentation # Documentation
This is a collection of API requests and response for most of the paths that google play API offers. In general, each requests usually return the following protobuf objects: This is a collection of API requests and response for most of the
paths that google play API offers. In general, each requests
usually return the following protobuf objects:
- *payload*: contains the response object (see `googleplay.proto` for all types of responses). - *payload*: contains the response object
- (optional) *preFetch*: if the payload contains an URL to be fetched in order to get results, these results may be pre-fetched by google serversand included in the original response. (see `googleplay.proto` for all types of responses).
- (optional) *preFetch*: if the payload contains an URL to be fetched
in order to get results, these results may be pre-fetched by google
servers and included in the original response.
Each requests is discussed in the related subfolder. Each requests is discussed in the related subfolder.

1480
gpapi/device.properties Normal file

File diff suppressed because it is too large Load Diff

33
scripts/fetch_devices.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
REPO_SRC="https://github.com/yeriomin/play-store-api"
REPO_LOCAL="/tmp/psapi"
RES_DIR="${REPO_LOCAL}/src/main/resources"
DEVS_FILE="./gpapi/device.properties"
command -v git >/dev/null 2>&1 || { echo "git not installed"; exit 1; }
if [ ! -d "./gpapi" ]; then
echo "No gpapi dir found! Make sure you're in googleplay-api root dir"
exit 1
fi
echo "==> Cloning play-store-api repo into $REPO_LOCAL"
git clone $REPO_SRC $REPO_LOCAL &>/dev/null
# clean device.properties file
echo "" > $DEVS_FILE
for dev in `ls $RES_DIR`; do
FILE="$RES_DIR/$dev"
NAME=`echo $dev | sed -e "s/device-\(.*\).properties/\1/"`
echo "==> appending device data for $NAME"
echo "[$NAME]" >> $DEVS_FILE
cat $FILE >> $DEVS_FILE
echo "" >> $DEVS_FILE
done
# cleanup
echo "==> Cleanup"
rm -rf $REPO_LOCAL