mirror of
https://gitlab.com/MisterBiggs/blog-static.git
synced 2025-06-15 22:56:49 +00:00
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
!(function () {
|
|
var o,
|
|
i,
|
|
n,
|
|
e,
|
|
r = "https://blog.ansonbiggs.com/ghost/api/v0.1/";
|
|
(n = {
|
|
api: function () {
|
|
var n,
|
|
e = Array.prototype.slice.call(arguments),
|
|
t = r;
|
|
return (
|
|
(n = e.pop()) && "object" != typeof n && (e.push(n), (n = {})),
|
|
((n = n || {}).client_id = o),
|
|
(n.client_secret = i),
|
|
e.length &&
|
|
e.forEach(function (n) {
|
|
t += n.replace(/^\/|\/$/g, "") + "/";
|
|
}),
|
|
t +
|
|
(function (n) {
|
|
var e,
|
|
t = [];
|
|
if (!n) return "";
|
|
for (e in n)
|
|
n.hasOwnProperty(e) &&
|
|
(n[e] || !1 === n[e]) &&
|
|
t.push(e + "=" + encodeURIComponent(n[e]));
|
|
return t.length ? "?" + t.join("&") : "";
|
|
})(n)
|
|
);
|
|
},
|
|
}),
|
|
(e = function (n) {
|
|
(o = n.clientId ? n.clientId : ""),
|
|
(i = n.clientSecret ? n.clientSecret : ""),
|
|
(r = n.url ? n.url : r.match(/{\{api-url}}/) ? "" : r);
|
|
}),
|
|
"undefined" != typeof window &&
|
|
((window.ghost = window.ghost || {}),
|
|
(window.ghost.url = n),
|
|
(window.ghost.init = e)),
|
|
"undefined" != typeof module && (module.exports = { url: n, init: e });
|
|
})();
|