bdo-scraper
Version:
A scraper for BDOCodex.com and BDDatabase.net.
20 lines (16 loc) • 518 B
JavaScript
const Controller = require('./Controller')
class SearchController extends Controller {
constructor(lang, term) {
super(null, lang, null)
this._term = encodeURIComponent(term)
}
get(flag) {
return this.format(this.parseFlag(flag))
}
parseFlag(flag) {
if (flag)
return `ac.php?l=${this._lang}&term=${this._term}`
return this.parseQuery({ a: 'search', l: this._lang, sq: this._term })
}
}
module.exports = SearchController