Commit e5e1345d authored by Ian Havelock's avatar Ian Havelock Committed by GitHub
Browse files

Merge pull request #1 from toddmotto/master

Update from source
parents 3ab6a52f 8e5f7b7c
* text=auto * text=auto
/.github export-ignore
/build export-ignore /build export-ignore
.travis.yml export-ignore .travis.yml export-ignore
README.md export-ignore README.md export-ignore
CONTRIBUTING.md export-ignore
...@@ -20,14 +20,14 @@ Example entry: ...@@ -20,14 +20,14 @@ Example entry:
| NASA | NASA data, including imagery | No | Yes | [Go!](https://api.nasa.gov) | | NASA | NASA data, including imagery | No | Yes | [Go!](https://api.nasa.gov) |
``` ```
Currently, the only accepted inputs for this field are as follows: \* Currently, the only accepted inputs for this field are as follows:
* `OAuth` - _the API supports OAuth_ * `OAuth` - _the API supports OAuth_
* `apiKey` - _the API uses a private key string/token for authentication - try and use the correct parameter_ * `apiKey` - _the API uses a private key string/token for authentication - try and use the correct parameter_
* `X-Mashape-Key` - _the name of the header which may need to be sent_ * `X-Mashape-Key` - _the name of the header which may need to be sent_
* `No` - _the API requires no authentication to run_ * `No` - _the API requires no authentication to run_
Please continue to follow the alphabetical ordering that is in place per section. Please continue to follow the alphabetical ordering that is in place per section. Each table column should be padded with one space on either side.
If an API seems to fall into multiple categories, please place the listing within the section most in line with the services offered through the API. For example, the Instagram API is listed under `Social` since it is mainly a social network, even though it could also apply to `Photography`. If an API seems to fall into multiple categories, please place the listing within the section most in line with the services offered through the API. For example, the Instagram API is listed under `Social` since it is mainly a social network, even though it could also apply to `Photography`.
......
Thanks for looking to open an issue for this project.
If you are opening an issue to suggest adding a new entry, please consider opening a pull request instead!
Thank you for taking the time to work on a Pull Request for this project!
To ensure your PR is dealt with swiftly please check the following:
- [ ] Your submissions are formatted according to the guidelines in the [contributing guide](CONTRIBUTING.md).
- [ ] Your changes are made in the [README](../README.md) file, not the auto-generated JSON.
- [ ] Your additions are ordered alphabetically.
- [ ] Your submission has a useful description.
- [ ] Each table column should be padded with one space on either side.
- [ ] You have searched the repository for any relevant issues or PRs.
- [ ] Any category you are creating has the minimum requirement of 3 items.
...@@ -9,7 +9,4 @@ before_script: ...@@ -9,7 +9,4 @@ before_script:
- cd build - cd build
script: script:
- ./main.sh - ./main.sh
after_success:
- ./build.sh
- ./deploy.sh
\ No newline at end of file
This diff is collapsed.
...@@ -36,14 +36,14 @@ function setupMd(filename, anchor) { ...@@ -36,14 +36,14 @@ function setupMd(filename, anchor) {
if (line.length < 2 || cur_line == lines.length) { if (line.length < 2 || cur_line == lines.length) {
break break
} }
if (line.startsWith("|")) { if (line.indexOf("|") == 0) {
arr.push(line + table_name) arr.push(line + table_name)
} }
} }
} }
console.log(anchor + " entries") console.log(anchor + " entries")
console.log("API | Description | Auth | HTTPS | Link | Section") console.log("API | Description | Auth | HTTPS | Link | Category")
console.log("|---|---|---|---|---|---|") console.log("|---|---|---|---|---|---|")
for (i = 0; i < arr.length; i++) { for (i = 0; i < arr.length; i++) {
console.log(arr[i]) console.log(arr[i])
...@@ -60,4 +60,4 @@ if (process.argv.length < 4) { ...@@ -60,4 +60,4 @@ if (process.argv.length < 4) {
} else { } else {
anchorText = process.argv[3]; anchorText = process.argv[3];
} }
setupMd(process.argv[2].toString(), anchorText); setupMd(process.argv[2].toString(), anchorText);
\ No newline at end of file
...@@ -25,6 +25,12 @@ if [[ $? != 0 ]]; then ...@@ -25,6 +25,12 @@ if [[ $? != 0 ]]; then
exit 1 exit 1
else else
echo "format validation passed!" echo "format validation passed!"
./build.sh && ./deploy.sh
if [[ $? != 0 ]]; then
echo "JSON build and deploy failed!"
else
echo "JSON build and deploy success!"
fi
fi fi
echo "running link validation..." echo "running link validation..."
......
This diff is collapsed.
...@@ -25,10 +25,35 @@ def add_error(line_num, val_index, message) ...@@ -25,10 +25,35 @@ def add_error(line_num, val_index, message)
when INDEX_LINK when INDEX_LINK
segment = "Link" segment = "Link"
end end
$errors.push("(L%03d) %-14.14s #{message}" % [line_num, segment]) $errors.push("(L%03d) %-14.14s #{message}" % [line_num, segment])
end end
################### CHECK ALPHABETICAL ORDER ###################
section = ''
sections = []
section_to_line_num = {}
section_to_entries = Hash.new {|h,k| h[k] = Array.new }
File.foreach(filename).with_index do | line, line_num |
if line.start_with?('###')
section = line.sub('###', '').lstrip.chop
sections.push(section)
section_to_line_num[section] = line_num + 1
end
# Skip non-markdown table lines and table schema lines
if !line.start_with?('|') || line.eql?("|---|---|---|---|---|\n")
next
end
# char to check is the first column
check_char = line.split("|")[1].strip.upcase
section_to_entries[section].push(check_char)
end
sections.each do | sect |
if section_to_entries[sect] != section_to_entries[sect].sort
add_error(section_to_line_num[sect], INDEX_TITLE, "#{sect} section is not in alphabetical order")
end
end
#################### CHECK LINE ENTRIES ########################
File.foreach(filename).with_index do | line, line_num | File.foreach(filename).with_index do | line, line_num |
line_num += 1 line_num += 1
......
...@@ -50,6 +50,8 @@ links.each do |link| ...@@ -50,6 +50,8 @@ links.each do |link|
if !allowed_codes.include?(res.code) if !allowed_codes.include?(res.code)
fails.push("(#{res.code}): #{link}") fails.push("(#{res.code}): #{link}")
end end
rescue HTTParty::RedirectionTooDeep
fails.push("(RTD): #{link}")
rescue Net::ReadTimeout rescue Net::ReadTimeout
fails.push("(TMO): #{link}") fails.push("(TMO): #{link}")
rescue Net::OpenTimeout rescue Net::OpenTimeout
...@@ -60,6 +62,8 @@ links.each do |link| ...@@ -60,6 +62,8 @@ links.each do |link|
fails.push("(SOK): #{link}") fails.push("(SOK): #{link}")
rescue Errno::ECONNREFUSED rescue Errno::ECONNREFUSED
fails.push("(CON): #{link}") fails.push("(CON): #{link}")
rescue Errno::ECONNRESET
next
end end
progressbar.increment progressbar.increment
end end
......
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment