aboutsummaryrefslogtreecommitdiff
path: root/subprojects/freeamo/src/search-pages
diff options
context:
space:
mode:
authordavid <public@beloved.name>2018-07-23 19:45:17 +0200
committerdavid <public@beloved.name>2018-07-23 19:45:17 +0200
commit85cea3c6634e9af141612a406ba15ebca37e20db (patch)
tree5ff272e9f4068b85fcfc84c09cd72a314af20391 /subprojects/freeamo/src/search-pages
parent29b7728d89b8c64220ffd06e268fdaa35dac7f45 (diff)
FreeAMO: Improved terminal output
Diffstat (limited to 'subprojects/freeamo/src/search-pages')
-rw-r--r--subprojects/freeamo/src/search-pages22
1 files changed, 14 insertions, 8 deletions
diff --git a/subprojects/freeamo/src/search-pages b/subprojects/freeamo/src/search-pages
index 3e894dc..bc4e14b 100644
--- a/subprojects/freeamo/src/search-pages
+++ b/subprojects/freeamo/src/search-pages
@@ -19,9 +19,7 @@ cd "$run_path/build/json/search-pages" || exit
base_uri="https://addons.mozilla.org/api/v$api_version/addons/search/?platform=$platform&sort=$sort&type=$type&app=$app&appversion=$appversion&page_size=$page_size&page=";
-echo "$base_uri"
function search-pages--download() {
-
function wget_page {
@@ -33,15 +31,14 @@ function search-pages--download() {
average_daily_users="$(jq ".results[].average_daily_users" "$page.json" | tail -n 1)"
}
-
+
+
page="1";
wget_page
page_count="$(jq ".page_count" "$page.json")";
pv__size="$page_count"
- source "$run_path/src/main_functions"
-
-
+
if [ "$debug" = true ]; then
pv__size="2";
@@ -56,6 +53,14 @@ function search-pages--download() {
pv__size="$page_count"
fi
+
+
+
+ source "$run_path/src/main_functions"
+
+
+
+ echo "Download $pv__size pages from: ${base_uri//page=/page=\$page}"
while [ "$page" -lt "$page_count" ]; do
@@ -82,17 +87,18 @@ function search-pages--filter() {
pv__size=$(find . -not -name . | wc -l)
output_file="$output_file_1";
source "$run_path/src/main_functions"
+
+ echo "Filter $pv__size search pages from EULA and native messaging."
rm -f "$output_file_1"
# Sort by file modification time stamp for the downloaded JSON files
find . -type f | sort -n | while read -r file; do
-
filename="$(echo $(basename "$file"))";
-
entry="0"; # Should not be 1
+
# Should not be limited to 3 in --debug mode.
for id in $(jq ".results[].average_daily_users" "$file"); do