Skip to content

Instantly share code, notes, and snippets.

@MuhammadSawalhy
Created November 20, 2021 11:33
Show Gist options
  • Save MuhammadSawalhy/19aa53d56e03a00ac514c72a4571d60f to your computer and use it in GitHub Desktop.
Save MuhammadSawalhy/19aa53d56e03a00ac514c72a4571d60f to your computer and use it in GitHub Desktop.

Revisions

  1. MuhammadSawalhy created this gist Nov 20, 2021.
    9 changes: 9 additions & 0 deletions get-terms.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash

    for page in {1..173}; do
    curl -L "https://techtionary.thinktech.sa/api/terms?page=$page" |
    jq .data > /tmp/terms.$page.json
    done

    node -p 'JSON.stringify(Array.from({length: 173}).map((_,index)=> require("/tmp/terms." + (index + 1) + ".json")).flat())' |
    jq > ~/myp/mobadarah/techtionary.thinktech.sa__terms.json
    24,154 changes: 24,154 additions & 0 deletions terms.json
    24,154 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.