Skip to content

Commit

Permalink
build: rename clearbit-logo into clearbit (#182)
Browse files Browse the repository at this point in the history
* build: rename clearbit-logo into clearbit

* fix: memo args

* test: update snapshot

* build: add coverage

* docs: add coverage badge
  • Loading branch information
Kikobeats authored Jun 20, 2019
1 parent ef95e3c commit 2e9fde8
Show file tree
Hide file tree
Showing 39 changed files with 254 additions and 200 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
</h1>

![Last version](https://img.shields.io/github/tag/microlinkhq/metascraper.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/microlinkhq/metascraper.svg?style=flat-square)](https://coveralls.io/github/microlinkhq/metascraper)
[![Build Status](https://img.shields.io/travis/microlinkhq/metascraper/master.svg?style=flat-square)](https://travis-ci.org/microlinkhq/metascraper)
[![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper)
[![NPM Status](https://img.shields.io/npm/dm/metascraper.svg?style=flat-square)](https://www.npmjs.org/package/metascraper)


> A library to easily scrape metadata from an article on the web using Open Graph, JSON+LD, regular HTML metadata, and series of fallbacks.
## Table of Contents
Expand Down Expand Up @@ -57,7 +59,7 @@ const metascraper = require('metascraper')([
require('metascraper-description')(),
require('metascraper-image')(),
require('metascraper-logo')(),
require('metascraper-clearbit-logo')(),
require('metascraper-clearbit')(),
require('metascraper-publisher')(),
require('metascraper-title')(),
require('metascraper-url')()
Expand Down Expand Up @@ -162,7 +164,7 @@ const metascraper = require('metascraper')([
require('metascraper-description')(),
require('metascraper-image')(),
require('metascraper-logo')(),
require('metascraper-clearbit-logo')(),
require('metascraper-clearbit')(),
require('metascraper-publisher')(),
require('metascraper-title')(),
require('metascraper-url')()
Expand All @@ -175,7 +177,7 @@ Use the first parameter to pass custom options specific per each rules bundle:

```js
const metascraper = require('metascraper')([
require('metascraper-clearbit-logo')({
require('metascraper-clearbit')({
size: 256,
format: 'jpg'
})
Expand All @@ -191,7 +193,7 @@ const metascraper = require('metascraper')([
| [`metascraper-amazon`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-amazon) | [![npm](https://img.shields.io/npm/v/metascraper-amazon.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-amazon) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-amazon&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-amazon) |
| [`metascraper-audio`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-audio) | [![npm](https://img.shields.io/npm/v/metascraper-audio.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-audio) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-audio&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-audio) |
| [`metascraper-author`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-author) | [![npm](https://img.shields.io/npm/v/metascraper-author.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-author) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-author&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-author) |
| [`metascraper-clearbit-logo`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-clearbit-logo) | [![npm](https://img.shields.io/npm/v/metascraper-clearbit-logo.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-clearbit-logo) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-clearbit-logo&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-clearbit-logo) |
| [`metascraper-clearbit`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-clearbit) | [![npm](https://img.shields.io/npm/v/metascraper-clearbit.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-clearbit) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-clearbit&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-clearbit) |
| [`metascraper-date`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-date) | [![npm](https://img.shields.io/npm/v/metascraper-date.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-date) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-date&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-date) |
| [`metascraper-description`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-description) | [![npm](https://img.shields.io/npm/v/metascraper-description.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-description) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-description&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-description) |
| [`@metascraper/helpers`](https://github.com/microlinkhq/metascraper/tree/master/packages/metascraper-helpers) | [![npm](https://img.shields.io/npm/v/@metascraper/helpers.svg?style=flat-square)](https://www.npmjs.com/package/@metascraper/helpers) | [![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-helpers&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-helpers) |
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"name": "Shawn Dempsey",
"email": "[email protected]"
},
{
"name": "Sampo Juustila",
"email": "[email protected]"
},
{
"name": "Steven Frostwick",
"email": "[email protected]"
Expand All @@ -30,10 +34,6 @@
{
"name": "Jesse Rogers",
"email": "[email protected]"
},
{
"name": "Sampo Juustila",
"email": "[email protected]"
}
],
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions packages/metascraper-amazon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@metascraper/helpers": "^5.4.6"
},
"devDependencies": {
"coveralls": "latest",
"lodash": "latest",
"mocha": "latest",
"nyc": "latest",
Expand All @@ -33,6 +34,7 @@
"index.js"
],
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "NODE_PATH=.. TZ=UTC NODE_ENV=test nyc mocha test"
},
"license": "MIT",
Expand Down
7 changes: 2 additions & 5 deletions packages/metascraper-audio/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { isMime, url: urlFn, isAudioUrl } = require('@metascraper/helpers')
const { isMime, audio } = require('@metascraper/helpers')

/**
* Wrap a rule with validation and formatting logic.
Expand All @@ -14,10 +14,7 @@ const createWrapper = fn => rule => ({ htmlDom, url }) => {
return fn(value, url)
}

const wrapAudio = createWrapper((value, url) => {
const urlValue = urlFn(value, { url })
return isAudioUrl(urlValue) && urlValue
})
const wrapAudio = createWrapper((value, url) => audio(value, { url }))

const withContentType = (url, contentType) =>
isMime(contentType, 'audio') ? url : false
Expand Down
2 changes: 2 additions & 0 deletions packages/metascraper-audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@metascraper/helpers": "^5.4.6"
},
"devDependencies": {
"coveralls": "latest",
"lodash": "latest",
"mocha": "latest",
"nyc": "latest",
Expand All @@ -33,6 +34,7 @@
"index.js"
],
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "NODE_PATH=.. TZ=UTC NODE_ENV=test nyc mocha test"
},
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions packages/metascraper-author/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"index.js"
],
"scripts": {
"coverage": "exit 0",
"test": "exit 0"
},
"license": "MIT"
Expand Down
73 changes: 0 additions & 73 deletions packages/metascraper-clearbit-logo/CHANGELOG.md

This file was deleted.

This file was deleted.

32 changes: 0 additions & 32 deletions packages/metascraper-clearbit-logo/index.js

This file was deleted.

32 changes: 0 additions & 32 deletions packages/metascraper-clearbit-logo/test/index.js

This file was deleted.

File renamed without changes.
73 changes: 73 additions & 0 deletions packages/metascraper-clearbit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.0.2](https://github.com/microlinkhq/metascraper-clearbit/compare/v5.0.1...v5.0.2) (2019-03-31)


### Bug Fixes

* ensure external requests has early timeout ([#162](https://github.com/microlinkhq/metascraper-clearbit/issues/162)) ([f7a7816](https://github.com/microlinkhq/metascraper-clearbit/commit/f7a7816))





## [5.0.1](https://github.com/microlinkhq/metascraper-clearbit/compare/v5.0.0...v5.0.1) (2019-03-17)

**Note:** Version bump only for package metascraper-clearbit





# [5.0.0](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.10.3...v5.0.0) (2019-03-17)

**Note:** Version bump only for package metascraper-clearbit





## [4.10.1](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.10.0...v4.10.1) (2019-01-25)

**Note:** Version bump only for package metascraper-clearbit





# [4.10.0](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.9.0...v4.10.0) (2019-01-13)


### Features

* remove unnecessary dependency ([8dbb1ac](https://github.com/microlinkhq/metascraper-clearbit/commit/8dbb1ac))





## [4.8.5](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.8.4...v4.8.5) (2018-12-25)

**Note:** Version bump only for package metascraper-clearbit





## [4.8.4](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.8.3...v4.8.4) (2018-12-16)


### Bug Fixes

* avoid use generic publisher ([#141](https://github.com/microlinkhq/metascraper-clearbit/issues/141)) ([c13f833](https://github.com/microlinkhq/metascraper-clearbit/commit/c13f833))





## [4.8.2](https://github.com/microlinkhq/metascraper-clearbit/compare/v4.8.1...v4.8.2) (2018-12-12)

**Note:** Version bump only for package metascraper-clearbit
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# metascraper-clearbit-logo
# metascraper-clearbit

[![npm](https://img.shields.io/npm/v/metascraper-clearbit-logo.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-clearbit-logo)
[![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-clearbit-logo&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-clearbit-logo)
[![npm](https://img.shields.io/npm/v/metascraper-clearbit.svg?style=flat-square)](https://www.npmjs.com/package/metascraper-clearbit)
[![Dependency Status](https://david-dm.org/microlinkhq/metascraper.svg?path=packages/metascraper-clearbit&style=flat-square)](https://david-dm.org/microlinkhq/metascraper?path=packages/metascraper-clearbit)

> metascraper integration with Clearbit Logo API.
## Install

```bash
$ npm install metascraper-clearbit-logo --save
$ npm install metascraper-clearbit --save
```

## API
Expand Down Expand Up @@ -40,7 +40,7 @@ Desaturates image if set to `true`.

## License

**metascraper-clearbit-logo** © [microlink.io](https://microlink.io), Released under the [MIT](https://github.com/microlinkhq/metascraper-clearbit-logo/blob/master/LICENSE.md) License.<br>
Authored and maintained by microlink.io with help from [contributors](https://github.com/microlinkhq/metascraper-clearbit-logo/contributors).
**metascraper-clearbit** © [microlink.io](https://microlink.io), Released under the [MIT](https://github.com/microlinkhq/metascraper-clearbit/blob/master/LICENSE.md) License.<br>
Authored and maintained by microlink.io with help from [contributors](https://github.com/microlinkhq/metascraper-clearbit/contributors).

> [microlink.io](https://microlink.io) · GitHub [@microlink.io](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
10 changes: 10 additions & 0 deletions packages/metascraper-clearbit/__snapshots__/index.js.snap-shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
exports['returns when is possible resolve logo 1'] = {
"logo": "https://logo.clearbit.com/facebook.com",
"publisher": "Facebook"
}

exports['otherwise returns null 1'] = {
"logo": null,
"publisher": null
}

Loading

0 comments on commit 2e9fde8

Please sign in to comment.