Skip to content

Instantly share code, notes, and snippets.

@cole007
Created March 5, 2014 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cole007/9375985 to your computer and use it in GitHub Desktop.
Save cole007/9375985 to your computer and use it in GitHub Desktop.
Google: Custom Search API
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
// note key and cx strings here
var url = 'https://www.googleapis.com/customsearch/v1?key=AIzaSyBjBWczqg-5fB_2IkJ9ewb6AfP7BSNO5ZA&cx=012215714774810169881:nkujpnbrxhi&q=atoms&fileType=pdf';
$(function() {
// see http://api.jquery.com/jquery.getjson/
var jqxhr = $.getJSON( url, function() {
console.log( "success" );
}).done(function(data) {
console.log(data);
}).fail(function(data) {
console.log( "error" );
});
});
</script>
</head>
<body>
<div id="results"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment