1.0.1 • Published 3 years ago
qiita-url-generator v1.0.1
QiitaURLGenerator
This npm can create Qiita URL with search option added.
Installing
$ npm install qiita-url-generator
Usage
Single search option
An example of the simplest search option specification.
const QiitaUrl = require('qiita-url-generator')
const searchOpt = 'title:Git'
const url = new QiitaUrl(searchOpt).generate()
console.log(url)
// => https://qiita.com/search?q=title%3AGit
Multiple search options
If you want to search with multiple conditions, separate them with space.
const searchOpt = 'title:Git tag:Ruby'
const url = new QiitaUrl(searchOpt).generate()
console.log(url)
// => https://qiita.com/search?q=title%3AGit+tag%3ARuby
URL with Sort option
If you want to display sorted, please select from created/rel/stock/like
const searchOpt = 'title:Git tag:Ruby'
const sortOpt = 'created'
const url = new QiitaUrl(searchOpt, sortOpt).generate()
console.log(url)
// => https://qiita.com/search?sort=created&q=title%3AGit+tag%3ARuby
Search options
Item | Example |
---|---|
Contains "2015" in the title | title:2015 |
The text contains "Qiita" | body:Qiita |
Contains "Ruby" in the code | code:Ruby |
with the "Ruby" tag | tag:Ruby |
created by sampleuser | user:sampleuser |
Does not contain "tag:Ruby" | -tag:Ruby |
More than 3 stocked | stocks:>3 |
created after 2015-10-09 | created:>2015-10-09 |
Updated since 2015-10-01 | updated:>2015-10 |
Contains "Ruby" or "Rails" | Ruby OR Rails |
Sort option
Item | Specified notation |
---|---|
New arrival order | created |
Related order | rel |
Stock number order | stock |
LGTM number order | like |