How to use querystring - 10 common examples

To help you get started, we’ve selected a few querystring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KiLMaN / T411-Torznab / server.js View on Github external
function researchMovie(show,context) {
	// _logger.debug(show);
	var showName = show['title'];
	_logger.debug("Researching for : " + showName);
	showName = showName.replace(/\([0-9]*\)/gmi, "").trim();
	showName = showName.replace(/\((US|FR|ES)\)/gmi, "").trim();
	showName = showName.replace(/['|"](s)*/gmi, "").trim();
	showName= require('querystring').escape(showName);

	_logger.debug("Clean Name : "+showName);
	var query = (context.req.query.q) ? context.req.query.q : showName;

	research( baseUrl + "/torrents/search/"+query ,reponseSearch.bind( {context: context} ),context.req.query);
}
function researchTvRage(show,context) {
github gbif / portal16 / app / controllers / api / charts / occurrenceCharts.ctrl.js View on Github external
async function getData(query) {
    let options = {
        url: apiConfig.occurrenceSearch.url + '?' + querystring.stringify(query),
        method: 'GET',
        fullResponse: true,
        json: true
    };
    let response = await request(options);
    if (response.statusCode !== 200) {
        // TODO log error
        throw 'Internal server error getting data';
    }
    return response.body;
}
github emil10001 / AWS-NodeJS-AngularJS-Demos / s3-demo / s3_utils.js View on Github external
s3.getSignedUrl('putObject', putParams, function (err, url) {
            if (!!err) {
                console.error(c.S3_GET_URLPAIR, err);
                socket.emit(c.S3_GET_URLPAIR, c.ERROR);
                return;
            }
            urlPair[c.S3_PUT_URL] = url;
            urlPair[c.S3_GET_URL] = "https://aws-node-demos.s3.amazonaws.com/" + qs.escape(key);
            socket.emit(c.S3_GET_URLPAIR, urlPair);
        });
    };
github lifeomic / cli / lib / cmds / fhir_cmds / search-del.js View on Github external
exports.handler = async argv => {
  if (argv.query) {
    argv.query = querystring.parse(argv.query);
  } else {
    argv.query = {};
  }

  argv.query['_tag'] = `http://lifeomic.com/fhir/dataset|${argv.project}`;

  const account = getAccount(argv);
  const url = `${account}/dstu3/${argv.type}?${querystring.stringify(argv.query)}`;
  await del(argv, url);

  console.log(chalk.green(`Deleted resources`));
};
github hsiW / WishBot / commands.js View on Github external
function get_gif(tags, func) {
	var params = {"api_key": "dc6zaTOxFJmzC", "rating": "r", "format": "json","limit": 1 };
	var query = qs.stringify(params);
	if (tags !== null) {query += "&tag=" + tags.join('+')}
	var request = require("request");
	request("http://api.giphy.com/v1/gifs/random?" + query, function (error, response, body) {
		if (error || response.statusCode !== 200) {bot.sendMessage(msg, "There was an error getting a gif");console.log(errorC(error));}
		else {var responseObj = JSON.parse(body); func(responseObj.data.id);}
	}.bind(this));
}
github oauthinaction / oauth-in-action-code / exercises / ch-11-ex-4 / completed / authorizationServer.js View on Github external
var decodeClientCredentials = function(auth) {
	var clientCredentials = new Buffer(auth.slice('basic '.length), 'base64').toString().split(':');
	var clientId = querystring.unescape(clientCredentials[0]);
	var clientSecret = querystring.unescape(clientCredentials[1]);	
	return { id: clientId, secret: clientSecret };
};
github oauthinaction / oauth-in-action-code / exercises / ch-15-ex-1 / completed / authorizationServer.js View on Github external
var decodeClientCredentials = function(auth) {
	var clientCredentials = new Buffer(auth.slice('basic '.length), 'base64').toString().split(':');
	var clientId = querystring.unescape(clientCredentials[0]);
	var clientSecret = querystring.unescape(clientCredentials[1]);	
	return { id: clientId, secret: clientSecret };
};
github oauthinaction / oauth-in-action-code / exercises / ch-15-ex-1 / authorizationServer.js View on Github external
var decodeClientCredentials = function(auth) {
	var clientCredentials = new Buffer(auth.slice('basic '.length), 'base64').toString().split(':');
	var clientId = querystring.unescape(clientCredentials[0]);
	var clientSecret = querystring.unescape(clientCredentials[1]);	
	return { id: clientId, secret: clientSecret };
};
github oauthinaction / oauth-in-action-code / exercises / ch-11-ex-5 / completed / authorizationServer.js View on Github external
var decodeClientCredentials = function(auth) {
	var clientCredentials = new Buffer(auth.slice('basic '.length), 'base64').toString().split(':');
	var clientId = querystring.unescape(clientCredentials[0]);
	var clientSecret = querystring.unescape(clientCredentials[1]);	
	return { id: clientId, secret: clientSecret };
};
github jonschlinkert / markdown-toc / index.js View on Github external
function linkify(tok, options) {
  var opts = utils.merge({}, options);
  if (tok && tok.content) {
    opts.num = tok.seen;
    var text = titleize(tok.content, opts);
    var slug = utils.slugify(tok.content, opts);
    slug = querystring.escape(slug);
    if (opts && typeof opts.linkify === 'function') {
      return opts.linkify(tok, text, slug, opts);
    }
    tok.content = utils.mdlink(text, '#' + slug);
  }
  return tok;
}

querystring

Node's querystring module for all engines.

MIT
Latest version published 4 years ago

Package Health Score

55 / 100
Full package analysis