https://github.com/kanocomputing/kw-meta-parse-api-server
A simple, small lightweight web API to parse meta-data from URLs
https://github.com/kanocomputing/kw-meta-parse-api-server
Last synced: 8 months ago
JSON representation
A simple, small lightweight web API to parse meta-data from URLs
- Host: GitHub
- URL: https://github.com/kanocomputing/kw-meta-parse-api-server
- Owner: KanoComputing
- License: mit
- Created: 2015-02-19T16:44:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-04T16:30:03.000Z (over 10 years ago)
- Last Synced: 2024-04-11T15:53:39.262Z (about 2 years ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 21
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## URL meta parser
> A simple, small lightweight web API using [Cheerio](https://www.npmjs.com/package/cheerio) and [Request](https://www.npmjs.com/package/request) to parse meta-data from URLs. Combines Facebook OpenGraph meta tags, standards HTML meta and DOM parsing to find results.
### Setup
```bash
git clone git@github.com:KanoComputing/kw-meta-parse-api-server.git
cd kw-meta-parse-api-server
npm install
```
### Running
Run `npm start` to start the server.
The server will be started `http://localhost:2000` or listen to a custom set by the `PORT` environment variable.
### API
#### `GET /meta?q=URL`
**Params**
* `q` (Query) - *URL to parse*
**Example URL**
`GET http://localhost:2000/meta?q=http://www.youtube.com`
**Example positive response**
```json
{
"success" : true,
"data" : {
"title" : "YouTube",
"description" : "Sign in now to see your channels and recommendations!",
"image" : {
"url" : "http://s.ytimg.com/yts/img/youtube_logo_stacked-vfl225ZTx.png"
},
"type" : "website",
"url" : "http://www.youtube.com/"
}
}
```
**Example negative response**
```json
{
"success" : false,
"error" : "Not found"
}
```
### Try it
Here's some live examples:
* [Kano home page](http://metaparse.herokuapp.com/meta/?q=www.kano.me)
* [Guardian home page](http://metaparse.herokuapp.com/meta/?q=guardian.co.uk)
* [Tech Crunch post](http://metaparse.herokuapp.com/meta/?q=http://techcrunch.com/2013/11/19/kano-kickstarter/)
Enjoy!
### Licence
Copyright (c) 2015 Kano Computing Ltd. - Released under the MIT license