Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mawrkus/ping-bong
🏓 A simple (SEO) ping tool that follows HTTP redirections
https://github.com/mawrkus/ping-bong
axios follow http http-redirect https ping redirections redirects seo
Last synced: 2 days ago
JSON representation
🏓 A simple (SEO) ping tool that follows HTTP redirections
- Host: GitHub
- URL: https://github.com/mawrkus/ping-bong
- Owner: mawrkus
- Created: 2018-03-09T23:21:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T09:58:32.000Z (over 1 year ago)
- Last Synced: 2024-10-12T23:23:53.154Z (about 1 month ago)
- Topics: axios, follow, http, http-redirect, https, ping, redirections, redirects, seo
- Language: JavaScript
- Homepage:
- Size: 538 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Ping Bong
[![npm](https://img.shields.io/npm/l/ping-bong.svg)](https://www.npmjs.org/package/ping-bong) [![npm](https://img.shields.io/npm/v/ping-bong.svg)](https://www.npmjs.org/package/ping-bong)
![Node version](https://img.shields.io/node/v/ping-bong.svg?style=flat-square)A simple SEO ping tool that follows HTTP redirections.
## 🏓 Installation
```shell
npm install -g ping-bong
```Or using it directly with [npx](https://docs.npmjs.com/cli/v7/commands/npx):
```shell
npx ping-bong http://gizmodo.com
```## 🏓 Usage
## CLI
```shell
npx ping-bong http://gizmodo.com
[
{
"method": "head",
"url": "http://gizmodo.com",
"to": "https://gizmodo.com/",
"statusCode": 301,
"statusText": "Moved Permanently",
"responseTime": 71,
"userAgent": "ping-bong/3.0.8"
},
{
"method": "head",
"url": "https://gizmodo.com/",
"to": "https://es.gizmodo.com/",
"statusCode": 302,
"statusText": "https://es.gizmodo.com/",
"responseTime": 68,
"userAgent": "ping-bong/3.0.8"
},
{
"method": "head",
"url": "https://es.gizmodo.com/",
"statusCode": 200,
"statusText": "OK",
"responseTime": 82,
"userAgent": "ping-bong/3.0.8"
}
]
```## API
```javascript
const PingBong = require('ping-bong');(async () => {
const pingyBong = new PingBong({
httpOptions: {
method: 'get',
headers: {
'User-Agent': 'pingee-beengee/42.0',
},
maxRedirects: 10,
},
includes: {
'request.method': 'method',
'request.url': 'url',
'response.headers.location': 'to',
'response.status': 'statusCode',
'response.statusText': 'statusText',
'response.responseTime': 'responseTime',
'request.headers.user-agent': 'userAgent',
},
});const redirections = await pingyBong.check({
url: 'http://gizmodo.com',
});console.log(JSON.stringify(redirections, null, 2));
})();
```## 🏓 Demo
```shell
$ git clone https://github.com/mawrkus/ping-bong.git
$ cd ping-bong
$ npm install
$ npm run demo
```