From 222f7c16acc41bc94b3acafbe719442c8131a73d Mon Sep 17 00:00:00 2001 From: david Date: Wed, 20 Jun 2018 14:03:06 +0200 Subject: Updated addons.mozilla.org-fsd to generate wiki text. --- addons.mozilla.org-fsd/sync-data/fsd-amo-bot | 164 --------------------------- 1 file changed, 164 deletions(-) (limited to 'addons.mozilla.org-fsd/sync-data') diff --git a/addons.mozilla.org-fsd/sync-data/fsd-amo-bot b/addons.mozilla.org-fsd/sync-data/fsd-amo-bot index 14b008d..4947ae7 100755 --- a/addons.mozilla.org-fsd/sync-data/fsd-amo-bot +++ b/addons.mozilla.org-fsd/sync-data/fsd-amo-bot @@ -115,168 +115,6 @@ case "$1" in ;; - --make-xml) - - if [ ! -d "build/fsd" ]; then mkdir -p build/fsd; fi - - # Get number of edits: - wget "https://directory.fsf.org/w/api.php?action=query&list=recentchanges&rclimit=1" -O fsdedits.xml - oldrevid="$(grep revid fsdedits.xml | sed "s|"||g; s|revid|\nrevid|; s|old_revid|\n|" | grep revid | sed "s|revid=||")" - newrevid=$(expr 1 + $oldrevid) - - cd build/ || exit - - while read url; do - - retrive - # List JSON structure: cat amo/json/$slug.json | js '.' - # XML value "homepage" is not always set in AMO API, but the FSD require "Homepage URL" to be set: Therfore we use the AMO page itself in Homepage URL to complete the build of the repo automatically. - echo " - - Free Software Directory - https://directory.fsf.org/wiki/Main_Page - MediaWiki 1.20.2 - first-letter - - Media - Special - - Talk - User - User talk - Free Software Directory - Free Software Directory talk - File - File talk - MediaWiki - MediaWiki talk - Template - Template talk - Help - Help talk - Category - Category talk - Property - Property talk - Form - Form talk - Concept - Concept talk - Filter - Filter talk - Review - Review talk - License - License talk - Collection - Collection talk - Org - Org talk - - - - IceCat/$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.name.enUS' | sed "s|^\"||; s|\"$||;") - - $newrevid - $(date -u +%Y-%m-%dT%H:%M:%SZ) - - amo-import - 1501 - - kj1p9nd2p15bqr2tb7jkihshlxow11y - {{Entry" > fsd/$slug.xml - - # Dash have to be removed in jq 1.3: https://github.com/stedolan/jq/issues/341 - echo "|Name=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.name.enUS' | sed "s|^\"||; s|\"$||;") -|Short description=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.summary.enUS' | sed "s|^\"||; s|\"$||; s|\\\n|\n|g; s|\\\\\"|\"|g;") -|Full description=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.description.enUS' | sed "s|^\"||; s|\"$||; s|\\\n|\n|g; s|\\\\\"|\"|g;") -|Homepage URL=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.homepage.enUS' | sed "s|^\"||; s|\"$||;")" >> fsd/$slug.xml - - - if [[ "$(cat amo/json/$slug.json | jq '.current_version.compatibility.seamonkey')" != "null" ]]; then - set_seamonkey="SeaMonkey,"; - fi - - if [[ "$(cat amo/json/$slug.json | jq '.current_version.compatibility.firefox')" != "null" ]]; then - set_icecat="IceCat,"; - fi - - if [[ "$(cat amo/json/$slug.json | jq '.current_version.compatibility.android')" != "null" ]]; then - set_icecatmobile="IceCatMobile,"; - fi - - if [[ "$(cat amo/json/$slug.json | jq '.current_version.compatibility.mobile')" != "null" ]]; then - set_icecatmobile="IceCatMobile,"; - fi - - if [[ "$(cat amo/json/$slug.json | jq '.current_version.compatibility.thunderbird')" != "null" ]]; then - set_thunderbird="Thunderbird,"; - fi - - echo "|Extension of=$(echo "$set_seamonkey$set_icecat$set_icecatmobile$set_thunderbird" | sed "s|,$||;")" >> fsd/$slug.xml - - - if [[ "$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.homepage.enUS' | grep "github.com")" != "null" ]]; then - echo "|VCS checkout command=git clone $(cat amo/json/$slug.json | sed "s|-||g;" | jq '.homepage.enUS' | sed "s|^\"||; s|\"$||;")" >> fsd/$slug.xml - fi - - echo "|VCS checkout command=git clone $(cat amo/json/$slug.json | sed "s|-||g;" | jq '.homepage.enUS' | sed "s|^\"||; s|\"$||;")"; - echo "|Version identifier=$(cat amo/json/$slug.json | jq '.current_version.version' | sed "s|^\"||; s|\"$||;") -|Version date=$(cat amo/json/$slug.json | jq '.last_updated' | sed "s|^\"||; s|\"$||;") -|Version download=https://addons.mozilla.org/firefox/downloads/latest/$slug/addon-$(cat amo/json/$slug.json | jq '.current_version.id')-latest.xpi -|Last review by=FSDbot -|Last review date=$(date +"%Y/%m/%d") -|Submitted by=FSDbot -|Submitted date=2017/02/01 -|Is GNU=No -}}" >> fsd/$slug.xml - - - # https://addons.mozilla.org/api/v3/addons/addon/noscript/versions/1910123/ - echo "{{Project license - -# Stuck here (have to use old API until this have been fixed): https://github.com/mozilla/addons-server/issues/3936 - -|License=$(cat amo/json.versions/$slug.json | sed "s|-||g;" | jq '.license.name.enUS' | sed "s|^\"||; s|\"$||;") -|License copyright=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.authors[].name' | sed "s|^\"||; s|\"$||;") -}}" >> fsd/$slug.xml - - # Homepage URL can be changed by the community so lets do a backup here - echo "{{Resource -|Resource audience=amo-import -|Resource kind=General -|Resource URL=$url -}}" >> fsd/$slug.xml - - - if [[ "$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.support_url[]' | sed "s|^\"||; s|\"$||;")" != "" ]]; - then - - echo "{{Resource -|Resource audience=Users -|Resource kind=Support -|Resource URL=$(cat amo/json/$slug.json | sed "s|-||g;" | jq '.support_url[]' | sed "s|^\"||; s|\"$||;") -}}" >> "fsd/$slug.xml" - - fi - - # Add "E-mail" here when "Support E-mail" have been added to the API: https://github.com/mozilla/addons-server/issues/3901 - - - echo "{{Featured}} - - -" >> "fsd/$slug.xml" - - cat "fsd/$slug.xml" - - - - done < ../amo-repo.txt - - - ;; - --all) @@ -284,8 +122,6 @@ case "$1" in $0 --get-xpi-url $0 --get-xpi $0 --xpi-extract - $0 --make-xml - ;; *) -- cgit v1.2.3