Update Domainr completion to use Mashape API

This commit is contained in:
Maddison Hellstrom 2017-11-18 00:59:01 -08:00
parent 4e0f75de8a
commit 126272989a
2 changed files with 3 additions and 8 deletions

View File

@ -157,7 +157,7 @@ completions.do = {
alias: 'do', alias: 'do',
name: 'domainr', name: 'domainr',
search: 'https://domainr.com/?q=', search: 'https://domainr.com/?q=',
compl: `https://api.domainr.com/v2/search?client_id=${keys.domainr}&query=%s`, compl: `https://domainr.p.mashape.com/v2/search?mashape-key=${keys.domainr}&query=%s`,
}; };
completions.do.callback = function(response) { completions.do.callback = function(response) {
@ -176,7 +176,7 @@ completions.do.callback = function(response) {
runtime.command({ runtime.command({
action: 'request', action: 'request',
method: 'get', method: 'get',
url: `https://api.domainr.com/v2/status?client_id=${keys.domainr}&domain=${domainQuery}` url: `https://domainr.p.mashape.com/v2/status?mashape-key=${keys.domainr}&domain=${domainQuery}`
}, function(sresponse) { }, function(sresponse) {
var sres = JSON.parse(sresponse.text).status; var sres = JSON.parse(sresponse.text).status;
sres.map(function(s) { sres.map(function(s) {

View File

@ -15,12 +15,7 @@ var keys = {
google_cs: "", // https://developers.google.com/custom-search/json-api/v1/overview?hl=en_US google_cs: "", // https://developers.google.com/custom-search/json-api/v1/overview?hl=en_US
google_yt: "", // https://developers.google.com/youtube/v3/docs/ google_yt: "", // https://developers.google.com/youtube/v3/docs/
wolframalpha: "", // https://products.wolframalpha.com/api/ wolframalpha: "", // https://products.wolframalpha.com/api/
domainr: "", // https://market.mashape.com/domainr/domainr
// Note:
// The Domainr API is configured for High-Volume usage, not Mashape.
// You will need to modify the code in completions.js to work with the Mashape API if desired.
// Open an issue if you can't figure this out and I'd be happy to help.
domainr: "", // https://domainr.build/docs/overview#section-try-it-for-free
//*** Google Custom Search Engines ***// //*** Google Custom Search Engines ***//
// Can be created at https://cse.google.com/cse // Can be created at https://cse.google.com/cse