Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/superoo7/steem-link-extractor
Link extractor from Steem App
https://github.com/superoo7/steem-link-extractor
blockchain dapps javascript jest nodejs rollup steem typescript
Last synced: 7 days ago
JSON representation
Link extractor from Steem App
- Host: GitHub
- URL: https://github.com/superoo7/steem-link-extractor
- Owner: superoo7
- License: mit
- Created: 2019-03-03T12:02:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T17:13:05.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T00:11:18.746Z (about 1 month ago)
- Topics: blockchain, dapps, javascript, jest, nodejs, rollup, steem, typescript
- Language: TypeScript
- Size: 337 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- Contributing: Contributing.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# steem-link-extractor
[![npm version](https://badge.fury.io/js/steem-link-extractor.svg)](https://www.npmjs.com/package/steem-link-extractor)
[![Build Status](https://travis-ci.org/superoo7/steem-link-extractor.svg?branch=master)](https://travis-ci.org/superoo7/steem-link-extractor)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)A simple tools to extract links and generate links for different steem platform.
## About Steem Link Extractor
In Steem blockchain, there is so many apps that used different kind of pathname to keep track of profile and post. This project aims to unite them all.
**Technology Stack:**
- TypeScript
- Jest
- Rollup## Housekeeping
- Checkout [Changelog](Changelog.md) for updates.
- Checkout [Contributing](Contributing.md) to contribute to this project.## Installation
```sh
$ npm i --save steem-link-extractor
$ yarn add steem-link-extractor
```## Requirement
- URL API required.
- Node 10+ (support `new URL`, [refer to this](https://nodejs.org/en/blog/release/v8.0.0/#say-hello-to-the-whatwg-url-parser))
- not IE 11 (Refer to [URL](https://caniuse.com/#feat=url))Polyfill required to support this library.
## Usage
You can checkout example at [index.js](src/example/index.js) and [index.mjs](src/example/index.mjs)
### Import
**ES5 import / TS Import**
```js
import {
extractPostLink,
generateProfileLink,
generatePostLink
} from "steem-link-extractor";
```**CommonJS**
```js
const {
extractPostLink,
generateProfileLink,
generatePostLink
} = require("steem-link-extractor");
```### API
```js
// extractPostLink// Extract with predefined link.json
console.log(
extractPostLink(
"https://steemit.com/cloud/@superoo7/side-to-side-comparison-of-digital-ocean-and-aws-lightsail"
)
);
/** Output
* {
* name: 'steemit',
* author: 'superoo7',
* permlink: 'side-to-side-comparison-of-digital-ocean-and-aws-lightsail',
* category: 'cloud'
* }
*/// Extract without predefined link.json (Assuming it is not yet being add into link.json)
// Currently presuming the site pathname is following format: `anything/anything/@{{author}}/{{permlink}}`
// author startsWith "@" and followed by permlink
console.log(
extractPostLink(
"https://steemit.com/cloud/@superoo7/side-to-side-comparison-of-digital-ocean-and-aws-lightsail",
{ automatic: true }
)
);// generateProfileLink
console.log(generateProfileLink("musing", "superoo7"));
/** Output
* https://musing.io/profile/superoo7
*/// generatePostLink
console.log(
generatePostLink(
"steemhunt",
"superoo7",
"tailwind-css-utility-first-css-framework"
)
);
/** Output
* https://steemhunt.com/@superoo7/tailwind-css-utility-first-css-framework
*/// if you have category
console.log(
generatePostLink(
"steemit",
"superoo7",
"side-to-side-comparison-of-digital-ocean-and-aws-lightsail",
"cloud"
)
);
/** Output
* https://steemit.com/cloud/@superoo7/side-to-side-comparison-of-digital-ocean-and-aws-lightsail
*/
```## LICENSE
MIT