https://github.com/willuhmjs/gotquestions
gotquestions is a package designed to scrape the gotquestions.org api
https://github.com/willuhmjs/gotquestions
Last synced: 11 months ago
JSON representation
gotquestions is a package designed to scrape the gotquestions.org api
- Host: GitHub
- URL: https://github.com/willuhmjs/gotquestions
- Owner: willuhmjs
- License: mit
- Created: 2021-08-07T02:27:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-07T21:49:24.000Z (over 4 years ago)
- Last Synced: 2025-04-10T20:16:35.568Z (about 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gotquestions
gotquestions is a package designed to scrape the gotquestions.org api
```js
const gq = require("/path/to/gotquestions/src/index.js");
(async () => {
await gq.fetchDataByQuery("Jesus");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
})();
```
## Documentation
### Error Handling
All errors return the following object
```js
{
error: true,
errorStack: "..."
}
```
### gq.fetchDataByUrl(url)
```js
await gq.fetchDataByUrl("https://www.gotquestions.org/prophecies-of-Jesus.html");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
```
### gq.fetchDataByQuery(query, index)
```js
await gq.fetchDataByQuery("Jesus", 0);
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "..."
}
*/
```
### gq.search(query)
```js
await gq.search("Jesus")
/*
{
error: false,
queryResults: [
{
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
url: "https://www.gotquestions.org/prophecies-of-Jesus.html"
},
...
]
}
*/
```
## License
**gotquestions** is licensed under the [MIT License](https://github.com/willuhm-js/gotquestions/blob/master/LICENSE).