35 lines
1.4 KiB
Markdown
35 lines
1.4 KiB
Markdown
### Search continents
|
|
|
|
**Example** : list all countries in Africa, as JSON file
|
|
|
|
```sh
|
|
osr-ai chatgpt prompt --query="List all countries in Africa, as JSON array" --dst="./meta/global/africa/index.json" --filters=JSON
|
|
```
|
|
|
|
**Example** : list all cities in an African country, as JSON file, using the country index as created above
|
|
|
|
```sh
|
|
osr-cli each --main='osr-ai chatgpt prompt --query='list all major cities in ${KEY}, as JSON array' --dst='${OSR_ROOT}/osr-directory/meta/global/africa/${KEY}/index.json' --filters=JSON --debug' --list='${OSR_ROOT}/osr-directory/meta/global/africa/index.json' --trace=true
|
|
```
|
|
|
|
**Example** : Create a list of related search queries, for an area
|
|
|
|
```sh
|
|
osr-ai chatgpt prompt --query="create a json formatted string, with 4 keys : plastic recycling, prototyping, handcraft, fablab. for each object, add an array with plastic & recycling related top searches for businesses, in english - for Africa" --dst="./meta/global/search/africa-terms.json" --append=true --filters=JSON
|
|
```
|
|
|
|
|
|
### Country Details
|
|
|
|
- [Source](./country_details.json) fetched from https://gist.github.com/ssskip/5a94bfcd2835bf1dea52
|
|
|
|
Converted to array via `jq` :
|
|
|
|
```sh
|
|
cat lang-iso-code-details.json | jq -r 'to_entries | map_values(.value + { code: .key })' > .lang-iso-code-details_flat.json
|
|
```
|
|
|
|
#### Query properties via JSONPath query
|
|
|
|
Country name by language iso code : `$[..][?(@.ISO2=='AF')]['Country Name']`
|