This is a simple Rails API that can be used to grab h1, h2, h3, and a tags from any page. It uses the Nokogiri gem to parse the HTML, and is hosted on Heroku: https://html-grabber-api.herokuapp.com
It runs on Rails 5 and has a PostgreSQL database.
- Go to the app to get a key.
- Sign up with your email.
- Place your key in an ENV variable to be accepted as a header.
- Send a
POSTrequest tohttps://html-grabber-api.herokuapp.com/parse, withurlparameters in the link. For example:
https://html-grabber-api.herokuapp.com/parse?url=https://zhao-andy.github.io
This grabs the HTML tags from that page. - To get data as JSON, send a
GETrequest with your email and API key in the header. Headers are accepted like so:
Authorization=>Token token=your_api_key
X-User-Email=>[email protected]
You can send to either the index route or the show route.
For the index route, use:
https://html-grabber-api.herokuapp.com/index.json
For the show route, use:
https://html-grabber-api.herokuapp.com/show.json?url=your-specific-urlYou can also view the page itself as JSON using the same links.
If you ever forget your key or you can simply go back to the app home page and login with your email.
Feel free to contribute! Simply fork and clone the repo.