Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skype Directory Search #64

Open
cameron5906 opened this issue May 4, 2017 · 0 comments
Open

Skype Directory Search #64

cameron5906 opened this issue May 4, 2017 · 0 comments

Comments

@cameron5906
Copy link

cameron5906 commented May 4, 2017

Didn't see a feature for this, so I made it. This will search the Skype directory. Just give it a query

RequestService.prototype.search = function(skypeAccount, query, cb) {
	var reqID = 'skype.com-1.88.30-' + Math.random().toString(36).substring(0,8) + '-' + Math.random().toString(36).substring(0,4) + '-' + Math.random().toString(36).substring(0,4) + '-' + Math.random().toString(36).substring(0,4) + '-' + Math.random().toString(36).substring(0,12);
	var reqURI = 'https://skypegraph.skype.com/search/v1.1/namesearch/swx/?requestid=' + reqID + '&searchstring=' + query + '&locale=en-us';
	var _this = this;
	this.requestWithJar(reqURI, {
		method: 'OPTIONS',
		headers: {
			'accept':'*/*',
			'accept-encoding':'gzip, deflate, sdch, br',
			'accept-language':'en-US,en;q=0.8',
			'access-control-request-headers':'content-type,x-skypetoken',
			'access-control-request-method':'GET',
			'host': 'skypegraph.skype.com',
			'origin':'https://web.skype.com',
			'referer':'https://web.skype.com/en/',
			'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36'
		}
	}, function(err, resp, body) {
		_this.requestWithJar(reqURI, {
			headers: {
				'Accept': 'application/json, text/javascript',
				'Accept-Encoding': 'gzip, deflate, br',
				'Accept-Language': 'en-US,en;q=0.8',
				'Content-Type': 'application/json',
				'Host': 'skypegraph.skype.com',
				'Origin': 'https://web.skype.com',
				'Referer': 'https://web.skype.com/en/',
				'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36',
				'X-Skypetoken': skypeAccount.skypeToken
			}
		}, function(err, resp, body) {
			cb(JSON.parse(body));
		});
	});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant