This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/libs/foundation/global.jsp"%><% | |
%><% | |
String url = properties.get("webpage", String.class); | |
%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cq:dialog jcr:primaryType="nt:unstructured" jcr:title="Embed" sling:resourceType="cq/gui/components/authoring/dialog"> | |
<content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"> | |
<items jcr:primaryType="nt:unstructured"> | |
<column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> | |
<items jcr:primaryType="nt:unstructured"> | |
<url | |
jcr:primaryType="nt:unstructured" | |
fieldDescription="URL of a page that supports oEmbed auto-discovery (e.g. YouTube)" | |
fieldLabel="Web page address" | |
name="./webpage" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
var github = { | |
token: null, | |
getUser: function() { | |
return request({ | |
"method":"GET", | |
"uri": "https://api.github.com/user", | |
"json": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
checkLicense: function(uri) { | |
return request({ | |
"method": "GET", | |
"uri": uri, | |
"json": true, | |
"headers": { | |
"Authorization": "Bearer " + github.token, | |
"User-Agent": "My little demo app" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
isPublic: function(repo) { | |
return !repo.private; | |
}, | |
isOriginal: function(repo) { | |
return !repo.fork; | |
}, | |
licenseUrl: function(repo) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
getUserRepos: function(uri, repos) { | |
return request({ | |
"method": "GET", | |
"uri": uri, | |
"json": true, | |
"resolveWithFullResponse": true, | |
"headers": { | |
"Authorization": "Bearer " + github.token, | |
"User-Agent": "My little demo app" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
getUserReposUrl: function(user) { | |
return user.repos_url; | |
} | |
}; | |
function main(params) { | |
github.token = params.token; | |
return github.getUser() | |
.then(github.getUserReposUrl); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
var github = { | |
token: null, | |
getUser: function() { | |
return request({ | |
"method":"GET", | |
"uri": "https://api.github.com/user", | |
"json": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
request({ | |
"method":"GET", | |
"uri": "https://api.github.com/", | |
"json": true, | |
"headers": { | |
"User-Agent": "My little demo app" | |
} | |
}).then(console.log, console.log); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
var github = { | |
token: null, | |
getUser: function() { | |
return request({ | |
"method":"GET", | |
"uri": "https://api.github.com/user", | |
"json": true, |