This file contains 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
#!/bin/bash | |
#=============================================================================== | |
# | |
# FILE: getgeo.sh | |
# | |
# USAGE: ./getgeo.sh | |
# | |
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your | |
# database | |
# |
This file contains 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
#!/bin/bash | |
#=============================================================================== | |
# | |
# FILE: getgeo.sh | |
# | |
# USAGE: ./getgeo.sh | |
# | |
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your | |
# database | |
# |
This file contains 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
module.exports = { | |
block: 'page', | |
title: 'Title of the page', | |
favicon: '/favicon.ico', | |
head: [ | |
{ elem: 'meta', attrs: { name: 'description', content: '' }}, | |
{ elem: 'css', url: 'index.min.css' } | |
], | |
scripts: [{ elem: 'js', url: 'index.min.js' }], | |
content: [ |
This file contains 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 google = require('googleapis'), | |
OAuth2 = google.auth.OAuth2; | |
function GoogleYoutube(credentials) { | |
this.oauth2Client = new OAuth2(credentials.client_id, credentials.client_secret, credentials.redirect_url); | |
}; | |
GoogleYoutube.prototype.searchList = function(user, params, callback) { | |
this.oauth2Client.setCredentials({ |
This file contains 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 Render = require('../render'), | |
render = Render.render, | |
config = require('../config'), | |
moment = require('moment'), | |
helpers = require('../helpers'), | |
env = process.env; | |
function getContent(req, res) { | |
var passport = req.session.passport || {}, | |
servicesYouTube = config.services.youtube, |
This file contains 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 passport = require('passport'), | |
YoutubeV3Strategy = require('passport-youtube-v3').Strategy, | |
env = process.env; | |
if (!env.YOUTUBE_APP_ID || !env.YOUTUBE_APP_SECRET) { | |
try { | |
var config = require('./config'), | |
servicesYouTube = config.services.youtube; | |
} catch (err) {} | |
} |
This file contains 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 Twitter = require('twitter'); | |
module.exports = function getContent(config, params) { | |
return new Promise(function(resolve, reject) { | |
new Twitter(config).get('search/tweets', params, function(err, data) { | |
if (err) return reject(err); | |
if(!data.statuses.length) return resolve({}); | |
resolve({ | |
nextPageId: data.statuses[data.statuses.length -1].id, |
This file contains 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 Render = require('../render'), | |
render = Render.render, | |
config = require('../config'), | |
moment = require('moment'), | |
helpers = require('../helpers'), | |
env = process.env; | |
/** | |
* Функция-обертка, контроллер. | |
* @function |
This file contains 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 router = require('express').Router(), | |
controllers = require('./controllers'); | |
router | |
.get('/ping/', function(req, res) { | |
res.send('ok'); | |
}) | |
.get('/', controllers.getContent); | |
module.exports = router; |
This file contains 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 fs = require('fs'), | |
app = require('./app'), | |
config = require('./config'), | |
env = process.env, | |
port = env.PORT || (env.PORT = config.defaultPort), | |
isSocket = isNaN(port); | |
exports.start = function() { | |
app | |
.listen(port, () => { |
NewerOlder