https://github.com/michimani/amazon-aws
The quiz "Amazon" or "AWS" or neither?
https://github.com/michimani/amazon-aws
aws quizapp
Last synced: 3 months ago
JSON representation
The quiz "Amazon" or "AWS" or neither?
- Host: GitHub
- URL: https://github.com/michimani/amazon-aws
- Owner: michimani
- Created: 2022-06-18T11:46:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T15:43:13.000Z (7 months ago)
- Last Synced: 2025-01-04T15:57:14.986Z (5 months ago)
- Topics: aws, quizapp
- Language: TypeScript
- Homepage: https://michimani.net/app/amazon-aws/
- Size: 5.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
amazon-aws
===The quiz "Amazon" or "AWS" or neither?
It can be played here. [Quiz Amazon or AWS](https://michimani.net/app/amazon-aws/)
## Source
[AWS Documentation](https://docs.aws.amazon.com/)
(Not working) Generate `amazon-aws.json` data.
```js
res = [];
checked = [];
document.querySelectorAll('section[aria-labelledby=user_guides] li').forEach((e) => {
const fullName = e.querySelector('span').innerText;
if (checked.includes(fullName) == true) {
return;
}
checked.push(fullName);
let prefix = '';
let name = '';
let prefixIdx = fullName.indexOf('AWS ');
if (prefixIdx == 0) {
prefix = 'AWS'
name = fullName.replace('AWS ', '');
} else if (prefixIdx < 0) {
prefixIdx = fullName.indexOf('Amazon ');
if (prefixIdx == 0) {
prefix = 'Amazon'
name = fullName.replace('Amazon ', '');
}
}if (name == '') {
name = fullName;
}
const fullURL = e.querySelector('a').href;
const queryIdx = fullURL.indexOf('?');
let url = '';
if (queryIdx < 0) {
url = fullURL;
} else {
url = fullURL.substring(0, queryIdx);
}
res.push({prefix: prefix, name: name, url: url});
})
console.log(JSON.stringify(res));
```## Run at local
```bash
npm start
```## Build
```bash
npm run build
```## Deploy
```bash
export S3_BUCKET='hoge'
export CF_DIST_ID='fuga'
aws s3 sync "build/" "s3://${S3_BUCKET}/app/amazon-aws/" \
&& aws cloudfront create-invalidation --distribution-id "${CF_DIST_ID}" --paths "/app/amazon-aws/*"
```## Author
[@michimani210](https://twitter.com/michimani210)