https://github.com/oeo/extract-redirects
extract redirect urls for dns-prefetching
https://github.com/oeo/extract-redirects
Last synced: 2 months ago
JSON representation
extract redirect urls for dns-prefetching
- Host: GitHub
- URL: https://github.com/oeo/extract-redirects
- Owner: oeo
- Created: 2016-02-23T22:23:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-23T22:34:59.000Z (about 9 years ago)
- Last Synced: 2025-02-23T10:03:32.037Z (3 months ago)
- Language: CoffeeScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# extract-redirects
# install
using [npm](https://npmjs.org)
```
npm i extract-redirects --save
```# example
``` coffeescript
log = console.log
extract = require 'extract-redirects'await extract 'http://x.com/v1/public/click/81dayvkn999', defer e,links
log /links/
log linksawait extract 'http://x.com/v1/public/click/81dayvkn999', {hosts_only:yes}, defer e,hosts
log /hosts/
log hosts###
/links/
[ 'http://x.com/v1/public/click/81dayvkn999',
'http://affiliate.x.com/rd/r.php?sid=1823&pub=22392&c1=&c2=&c3=',
'https://www.final.com/finalurl/?affid=gos&saffid=22000' ]
/hosts/
[ 'http://x.com',
'http://affiliate.x.com',
'https://www.final.com' ]
###
```