diff --git a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js index b81e68f11..c6c230eda 100644 --- a/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js +++ b/extensions/freebase/module/scripts/dialogs/freebase-loading-dialog.js @@ -46,6 +46,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() { var authorization = this._elmts.authorization; var loadButton = this._elmts.loadButton; + // TODO: Does this need to be redone for the new API / freebase.com site? var check_authorization = function(cont) { var check_authorization_url = "command/freebase/check-authorization/" + provider; $.get(check_authorization_url, function(data) { diff --git a/extensions/freebase/module/scripts/dialogs/schema-alignment/dialog.js b/extensions/freebase/module/scripts/dialogs/schema-alignment/dialog.js index 0394591c6..26c8ef98f 100644 --- a/extensions/freebase/module/scripts/dialogs/schema-alignment/dialog.js +++ b/extensions/freebase/module/scripts/dialogs/schema-alignment/dialog.js @@ -99,6 +99,8 @@ SchemaAlignment._batchSearch = function(queries, onDone) { batch[key] = queries[key]; } + // TODO: New API doesn't accept multiple queries +// args.push("https://www.googleapis.com/freebase/v1/search?key=" + Freebase.API_KEY + "&" + args.push("http://api.freebase.com/api/service/search?" + $.param({ "queries" : JSON.stringify(batch) }) + "&callback=?"); diff --git a/extensions/freebase/module/scripts/dialogs/schema-alignment/ui-link.js b/extensions/freebase/module/scripts/dialogs/schema-alignment/ui-link.js index ee1108e6d..bf71e4e2b 100644 --- a/extensions/freebase/module/scripts/dialogs/schema-alignment/ui-link.js +++ b/extensions/freebase/module/scripts/dialogs/schema-alignment/ui-link.js @@ -340,15 +340,13 @@ SchemaAlignmentDialog.UILink.prototype._configureTarget = function() { var dismissBusy = DialogSystem.showBusy(); $.getJSON( - "http://api.freebase.com/api/service/mqlread?query=" + JSON.stringify({ - query: { + "https://www.googleapis.com/freebase/v1/mqlread?key="+ Freebase.API_KEY + "&query=" + JSON.stringify({ "id" : this._link.property.id, "type" : "/type/property", "expected_type" : { "id" : null, "name" : null, "/freebase/type_hints/mediator" : null - } } }) + "&callback=?", null, diff --git a/extensions/freebase/module/scripts/util/freebase.js b/extensions/freebase/module/scripts/util/freebase.js index 302162ee4..ee396b2d0 100644 --- a/extensions/freebase/module/scripts/util/freebase.js +++ b/extensions/freebase/module/scripts/util/freebase.js @@ -33,12 +33,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var Freebase = {}; +Freebase.API_KEY = "AIzaSyBAZ_EjMPKlOzyyZXv6JKXPPwJFISVji3M"; + Freebase.mqlread = function(query, options, onDone) { var params = {}; - var queryEnv = { - "query": query - }; +// var queryEnv = { +// "query": query +// }; + // TODO: Options need to be handled differently for new API - but this doesn't appear to be used if (options) { for (var n in options) { if (options.hasOwnProperty(n)) { @@ -52,10 +55,10 @@ Freebase.mqlread = function(query, options, onDone) { } } - params.query = JSON.stringify(queryEnv); + params.query = JSON.stringify(query); $.getJSON( - "http://api.freebase.com/api/service/mqlread?" + $.param(params) + "&callback=?", + "https://www.googleapis.com/freebase/v1/mqlread?key=" + Freebase.API_KEY + $.param(params) + "&callback=?", null, onDone, "jsonp" diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js index 3b6c025c2..27efb6984 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js @@ -89,8 +89,8 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { "id" : data.id, "type" : [] }; - var baseUrl = "http://api.freebase.com/api/service/mqlread"; - var url = baseUrl + "?" + $.param({ query: JSON.stringify({ query: query }) }) + "&callback=?"; + var baseUrl = "https://www.googleapis.com/freebase/v1/mqlread?key=" + Freebase.API_KEY + "&"; + var url = baseUrl + $.param({ query: JSON.stringify(query) }) + "&callback=?"; $.getJSON( url,