bin/json: pull-chapters-data -> pull-chapter-metadata
This commit is contained in:
parent
820111e249
commit
827710107d
3 changed files with 11 additions and 11 deletions
14
README.md
14
README.md
|
@ -13,7 +13,7 @@ in English, Farsi, and Portuguese. The contents are made available in JSON, and
|
||||||
This section covers the JSON files. Click [here](#srcsql-directory) to jump to the SQL
|
This section covers the JSON files. Click [here](#srcsql-directory) to jump to the SQL
|
||||||
section.
|
section.
|
||||||
|
|
||||||
* The [src/json/chapters-data.json](src/json/chapters-data.json) file contains information
|
* The [src/json/chapter-metadata.json](src/json/chapter-metadata.json) file contains information
|
||||||
about each chapter in The Qur'an.
|
about each chapter in The Qur'an.
|
||||||
|
|
||||||
* The [src/json/ar/](src/json/ar/) directory contains The Qur'an in its original Arabic.
|
* The [src/json/ar/](src/json/ar/) directory contains The Qur'an in its original Arabic.
|
||||||
|
@ -26,12 +26,12 @@ section.
|
||||||
|
|
||||||
#### Chapters
|
#### Chapters
|
||||||
|
|
||||||
* [src/json/chapters-data.json](/src/json/chapters-data.json)
|
* [src/json/chapter-metadata.json](/src/json/chapter-metadata.json)
|
||||||
|
|
||||||
The [chapters-data.json](/src/json/chapters-data.json) file was obtained from https://quran.com,
|
The [chapter-metadata.json](/src/json/chapter-metadata.json) file was obtained from https://quran.com,
|
||||||
and modified slightly.
|
and modified slightly.
|
||||||
|
|
||||||
The [chapters-data.json](/src/json/chapters-data.json) file contains information about each
|
The [chapter-metadata.json](/src/json/chapter-metadata.json) file contains information about each
|
||||||
chapter in The Qur'an. It is structured as an array of objects, with each object describing
|
chapter in The Qur'an. It is structured as an array of objects, with each object describing
|
||||||
a given chapter. The following example demonstrates how Al-Fatihah is described as an object.
|
a given chapter. The following example demonstrates how Al-Fatihah is described as an object.
|
||||||
The "codepoints" property is a sequence of unicode codepoints can be mapped back to an Arabic word:
|
The "codepoints" property is a sequence of unicode codepoints can be mapped back to an Arabic word:
|
||||||
|
@ -329,9 +329,6 @@ contents of the [src/](src/) directory:
|
||||||
|
|
||||||
* JSON scripts
|
* JSON scripts
|
||||||
|
|
||||||
* [bin/json/pull-chapters-data](bin/json/pull-chapters-data) <br>
|
|
||||||
The script is responsible for generating [src/json/chapters-data.json](src/json/chapters-data.json).
|
|
||||||
|
|
||||||
* [bin/json/pull-arabic](bin/json/pull-arabic) <br>
|
* [bin/json/pull-arabic](bin/json/pull-arabic) <br>
|
||||||
This script is responsible for populating [src/json/ar/](src/json/ar/).
|
This script is responsible for populating [src/json/ar/](src/json/ar/).
|
||||||
|
|
||||||
|
@ -344,6 +341,9 @@ contents of the [src/](src/) directory:
|
||||||
* [bin/json/pull-portuguese](bin/json/pull-portuguese) <br>
|
* [bin/json/pull-portuguese](bin/json/pull-portuguese) <br>
|
||||||
This script is responsible for populating [src/json/pt/](src/json/pt/).
|
This script is responsible for populating [src/json/pt/](src/json/pt/).
|
||||||
|
|
||||||
|
* [bin/json/pull-chapter-metadata](bin/json/pull-chapter-metadata) <br>
|
||||||
|
The script is responsible for generating [src/json/chapter-metadata.json](src/json/chapter-metadata.json).
|
||||||
|
|
||||||
* SQL scripts
|
* SQL scripts
|
||||||
|
|
||||||
* [bin/sql/create-sql-seed-file](bin/sql/create-sql-seed-file) <br>
|
* [bin/sql/create-sql-seed-file](bin/sql/create-sql-seed-file) <br>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
##
|
##
|
||||||
# This script requests information about the chapters of
|
# This script requests information about the chapters of
|
||||||
# The Qur'an from the website https://quran.com, and writes
|
# The Qur'an from the website https://quran.com, and writes
|
||||||
# the result to src/json/chapters-data.json.
|
# the result to src/json/chapter-metadata.json.
|
||||||
|
|
||||||
##
|
##
|
||||||
# Set process name - primarily for the "ps" command
|
# Set process name - primarily for the "ps" command
|
||||||
Process.setproctitle("quran-pull (pull-chapters-data)")
|
Process.setproctitle("quran-pull (pull-chapter-metadata)")
|
||||||
|
|
||||||
##
|
##
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
@ -21,7 +21,7 @@ require "paint"
|
||||||
##
|
##
|
||||||
# Configuration variables.
|
# Configuration variables.
|
||||||
base_uri = "quran.com"
|
base_uri = "quran.com"
|
||||||
dest = File.join('src', 'json', 'chapters-data.json')
|
dest = File.join('src', 'json', 'chapter-metadata.json')
|
||||||
|
|
||||||
##
|
##
|
||||||
# Share a single Net::HTTP instance.
|
# Share a single Net::HTTP instance.
|
||||||
|
@ -60,4 +60,4 @@ end
|
||||||
##
|
##
|
||||||
# Write result
|
# Write result
|
||||||
File.write(dest, JSON.pretty_generate(parsed))
|
File.write(dest, JSON.pretty_generate(parsed))
|
||||||
print Paint["OK: ", :green, :bold], dest, "\n"
|
print Paint["OK ", :green, :bold], dest, "\n"
|
Loading…
Reference in a new issue