aboutsummaryrefslogtreecommitdiff
path: root/subprojects/freeamo/src/unmaintained/make-repository-list~
diff options
context:
space:
mode:
authordavid <public@beloved.name>2018-07-17 16:04:35 +0200
committerdavid <public@beloved.name>2018-07-17 16:04:35 +0200
commit4db097df535402d7e7de93022f42f69e4f7a3663 (patch)
tree4dc8b88e57837f0d7eea0cedc1f34e6c44832201 /subprojects/freeamo/src/unmaintained/make-repository-list~
parent1ae516a7bab1d5d9f02ab00c4ac13c219f43c1a1 (diff)
Renamed the AMO/FSD project to FreeAMO, and rewrote its architecture.
Diffstat (limited to 'subprojects/freeamo/src/unmaintained/make-repository-list~')
-rw-r--r--subprojects/freeamo/src/unmaintained/make-repository-list~78
1 files changed, 0 insertions, 78 deletions
diff --git a/subprojects/freeamo/src/unmaintained/make-repository-list~ b/subprojects/freeamo/src/unmaintained/make-repository-list~
deleted file mode 100644
index 97dc82d..0000000
--- a/subprojects/freeamo/src/unmaintained/make-repository-list~
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env bash
-
-# It is ok to distribute only-free programs on addons.mozilla.org even if they distribute nonfree programs.
-# This function requires _much_ less maintainance for custom add-on's, you don't need to manually sync
-# your addons.mozilla.org collection list with a separate text file.
-
-# https://github.com/mozilla/addons/issues/722
-# Cannot list collections in desired formats
-# Cannot get a list of names of Collections from other users like https://addons.mozilla.org/collections/mozilla/ without authenication (see https://addons-server.readthedocs.io/en/latest/topics/api/collections.html#list).
-# So we have to parse it from HTML.
-
-
-# Get the links to the collections
-
-function get_repositories {
-
- check_type="repositories";
- check_files
-
- cd build/ || exit
-
- for i in $(cat ../FreeAMO-repositories); do
-
- user=$(echo $i | sed "s|https://addons.mozilla.org/en-US/firefox/collections/||; s|/||;");
- rm -f repository-$user
-
-
- function wget_repository {
-
- match="^ <a href=\"/en-US/firefox/collections/"
- wget -qO- $i$wget_repository__page_extension | grep "$match" | sed "s|$match|https://addons.mozilla.org/en-US/firefox/collections/|; s|\">||" >> repository-$user
-
- }
-
- # Figure out if there are several pages
- number_of_pages=$(wget -qO- $i | grep "?page=" | tail -n 2 | head -n 1 | sed "s|page=|\npage=|g; s|\"|\n\"|g" | grep "page=" | sed "s|page=||");
-
- if [ -z "$number_of_pages" ]; then
-
- echo "$i doesn't have any sub pages";
- wget_repository
-
- else
-
- echo "$i has sub pages";
-
- page_number=1;
-
- while [ $page_number -le $number_of_pages ]
- do
-
- wget_repository__page_extension="?page=$page_number";
- echo "$wget_repository__page_extension"
- wget_repository
- page_number=$(( $page_number + 1 ))
-
- done
-
- fi
-
- done
-}
-get_repositories
-
-
-# Download the JSON files from the collections
-
-cd ..
-for x in $(find build/ -name repository* | sort); do
-
- for i in $(cat $x); do
-
- collection_name=$(echo $i | sed "s|https://addons.mozilla.org/en-US/firefox/collections/||; s|/|-|; s|/$||");
- wget $i"format%3Ajson" -O "build/collection-$collection_name.json"
-
- done
-
-done