GithubHelp home page GithubHelp logo

catalinmiron / micro-open-graph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from withspectrum/micro-open-graph

0.0 3.0 0.0 268 KB

A tiny Node.js microservice to scrape open graph data with joy.

License: MIT License

JavaScript 100.00%

micro-open-graph's Introduction

micro-open-graph

A tiny Node.js microservice to scrape open graph data with joy.

Running this microservice you won't need a backend solely to get some meta information about links your users submit. Press the deploy button below and show your users what the links they're clicking on contain!

Deployment

Your own micro-open-graph is one click away:

Deploy to now

You can also deploy with a single command from the terminal (assuming you have now installed):

now withspectrum/micro-open-graph

Usage

To get the data for a given URL, for example mxstbr.blog, simply add that URL (safely escaped) to the url query parameter:

https://your-url.now.sh/?url=http://mxstbr.blog

And you will get the parsed data in the following format:

{
	"author": null,
	"date": "2017-02-16T11:00:00.000Z",
	"description": "Fresh thinking and expert tips about HTML, CSS, JavaScript and other web technologies.",
	"image": "http://mxstbr.blog/social_media.png",
	"publisher": "<mxstbr/>",
	"title": "<mxstbr/>",
	"url": "http://mxstbr.blog/"
}

Note: Not all of this, or even more, data might be available depending on the meta tags the page has in its HTML. (see metascraper for the full list of supported properties)

We infer the data from more places than just the open graph meta tags, we also support twitter meta tags and fallback to standard HTML tags like e.g. the title tag if no open graph data was specified. Results are cached in memory for 24 hours, which means calling this with the same URL repeatedly won't have a large impact on your server!

Development

git clone [email protected]:withspectrum/micro-open-graph.git
npm run dev

The server will then be listening at localhost:3000.

Updating

The master branch of this repository is what you will be deploying. To update to a new version with potential bugfixes, all you have to do is run the now command again and change the URL you call in your app! ๐Ÿ‘Œ

License

Copyright (c) 2017 Maximilian Stoiber, licensed under the MIT license. See LICENSE.md for more information.

micro-open-graph's People

Contributors

agudulin avatar brianlovin avatar depfu[bot] avatar mxstbr avatar oyeanuj avatar pontusab avatar raxityo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.