This project is only an example of how to create a parser/API based on web scrapping. Its only purpose is to show/learn a more functional/promise-friendly way of scrapping the web.
It retrieves basic information, if you need a complete profile of every superhero known, go to the original site SuperHeroDB.
- Install the package
npm install superherodb-parser
// search.js
'use strict';
const shdb = require('superherodb-parser');
const heroName = 'hulk';
shdb.search(heroName).then((res) => {
console.log('Search result : ');
console.log(JSON.stringify(res, null, 2));
});
// fetch.js
'use strict';
const shdb = require('superherodb-parser');
const heroId = '/iron-man/10-85/';
shdb.fetch(heroId).then((res) => {
console.log('Your hero stats: ');
console.log(JSON.stringify(res, null, 2) );
});
- Improve the ID fetch parameters
- Add a group search
- Add more examples
- Create a CLI package
This project is not affiliated with SuperHeroDB.com site. All the credits for a great site is theirs.