Skip to content

Commit

Permalink
2017 edition!
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura González committed Jan 1, 2017
1 parent ab17231 commit aa64c15
Show file tree
Hide file tree
Showing 12 changed files with 501 additions and 111 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
node_modules/*
npm-debug.log

dist/textbook.js
dist/textbook.js.map

build
build/*
!build/.exists

.DS_Store
Empty file removed build/.exists
Empty file.
16 changes: 0 additions & 16 deletions dist/index.html

This file was deleted.

77 changes: 52 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var uglify = require('gulp-uglify');
var path = require('path');
var WrapperPlugin = require('wrapper-webpack-plugin');
var webshot = require('gulp-webshot');
var fs = require('fs');
var fs = require('fs-extra');

var env = require('./src/env.js');
var Twit = require('twit')
Expand Down Expand Up @@ -37,7 +37,7 @@ var webpackModule = {
};

gulp.task('tweet',function(done){
var b64content = fs.readFileSync('build/index.jpeg', { encoding: 'base64' });
var b64content = fs.readFileSync('build/book.jpg', { encoding: 'base64' });
T.post('media/upload', { media_data: b64content }, function (err, data, response) {
var params = { status: '', media_ids: [data.media_id_string] }
T.post('statuses/update', params, function (err, data, response) {
Expand All @@ -46,31 +46,50 @@ gulp.task('tweet',function(done){
})
})

gulp.task('webshot',function(){
return gulp.src('dist/index.html')
.pipe(webshot({
dest: 'build/',
root: 'dist',
renderDelay: 20000,
streamType: 'jpeg',
quality: 75,
screenSize: {
width: 800,
height: 1100
}
}))
})
gulp.task('webshot',function(done){

gulp.task('shitpost',
gulp.series('webshot','tweet')
);
var webshot = require('webshot');

var options = {
renderDelay: 20000,
siteType: 'file',
phantomPath: require('phantomjs2').path,
phantomConfig: {
'local-to-remote-url-access':'true',
'web-security':'false'
},
userAgent: 'Mozilla/4.0 (iPad; CPU OS 4_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/4.1 Mobile/9A405 Safari/7534.48.3',
errorIfJSException: true,
quality: 75,
screenSize: {
width: 800,
height: 1100
}
};

webshot('build/index.html', 'build/book.jpg', options, function(err) {
if(err) {
console.error(err);
}
else {
done();
}
});

});

gulp.task('test', function (done) {
console.log('yes it works its perfect');
gulp.task('_makefiles',function(done){
fs.removeSync('build');
fs.mkdirsSync('build');
fs.copySync('src/template/index.html','build/index.html');
var data = fs.readFileSync('build/index.html');
data = data.toString();
data = data.replace('{{base}}','file://'+__dirname+'/build/index.html');
fs.writeFileSync('build/index.html', data);
done();
});

gulp.task('default', function() {
gulp.task('_makejs', function() {
return gulp.src('src/index.js')
.pipe(webpack({
output: {
Expand Down Expand Up @@ -98,11 +117,10 @@ gulp.task('default', function() {
root: path.resolve('./src')
}
}))
.pipe(gulp.dest('dist/'));
.pipe(gulp.dest('build/'));
});

gulp.task('watch',function() {

return gulp.src('src/index.js')
.pipe(webpack({
watch: true,
Expand Down Expand Up @@ -132,5 +150,14 @@ gulp.task('watch',function() {
root: path.resolve('./src')
}
}))
.pipe(gulp.dest('dist/'));
.pipe(gulp.dest('build/'));
})


gulp.task('default',
gulp.series('_makefiles','_makejs')
);

gulp.task('shitpost',
gulp.series('default','webshot','tweet')
);
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"babel-core": "^6.11.4",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.9.0",
"color-scheme": "0.0.5",
"document-ready-promise": "^3.0.1",
"es6-promise": "^4.0.5",
"es6-promise-promise": "1.0.0",
"fs-extra": "^1.0.0",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-github-release": "^1.2.0",
"gulp-mocha-phantomjs": "^0.12.0",
Expand All @@ -30,10 +32,12 @@
"mocha": "^2.5.3",
"mocha-phantomjs": "^4.1.0",
"mustache": "^2.2.1",
"phantomjs2": "^2.2.0",
"raw-loader": "^0.5.1",
"twit": "^2.2.5",
"webpack": "^1.13.1",
"webpack-stream": "^3.2.0",
"webshot": "^0.18.0",
"wrapper-webpack-plugin": "0.1.11"
}
}
107 changes: 106 additions & 1 deletion src/data/majors.js
Original file line number Diff line number Diff line change
@@ -1 +1,106 @@
module.exports = ["Accounting","Actuarial Science","Advertising","Agriculture","Agricultural and Biological Engineering","Agricultural Business Management","Agriculture Economics","Animal Bioscience","Animal Sciences","Anthropology","Applied Mathematics","Archaeology","Architectural Engineering","Architecture","Art History","Studio Art","Art Education","Biobehavioral Health","Biochemistry","Bioengineering","Biology","Biophysics","Biotechnology","Business Administration and Management","Business Logistics","Chemical Engineering","Chemistry","Children","Civil Engineering","Computer Engineering","Computer Science","Crime, Law, and Justice","Dance","Earth Sciences","Economics","Electrical Engineering","Elementary and Kindergarten Education","Engineering Science","English","Environmental Systems Engineering","Environmental Sciences","Environmental Resource Management","Film and Video","Finance","Food Science","Forest Science","Forest Technology","General Science","Geography","Geosciences","Graphic Design and Photography","Health and Physical Education","Health Policy and Administration","History","Horticulture","Hotel, Restaurant, and Institutional Management","Human Development and Family Studies","Individual and Family Studies","Industrial Engineering","Information Sciences and Technology","Journalism","Kinesiology","Landscape Architecture","Law Enforcement and Correction","Marine Biology","Marketing","Mathematics","Mechanical Engineering","Media Studies","Meteorology","Microbiology","Mineral Economics","Modern Languages","Music Education","Nuclear Engineering","Nursing","Nutrition","Philosophy","Physics","Physiology","Political Science","Pre-medicine","Psychology","Public Relations","Real Estate","Recreation and Parks","Rehabilitation Services","Religious Studies","Secondary Education","Sociology","Social Work","Special Education","Speech Communication","Speech Pathology and Audiology/Communication Disorder","Statistics","Telecommunications","Theater","Wildlife and Fishery Science","Wildlife Technology","Gender Studies"];
module.exports = [
"Accounting",
"Actuarial Science",
"Advertising",
"Agriculture",
"Agricultural Engineering",
"Agricultural Business Management",
"Agriculture Economics",
"Animal Bioscience",
"Animal Sciences",
"Anthropology",
"Applied Mathematics",
"Archaeology",
"Architectural Engineering",
"Architecture",
"Art History",
"Studio Art",
"Art Education",
"Biobehavioral Health",
"Biochemistry",
"Bioengineering",
"Biological Engineering",
"Biology",
"Biophysics",
"Biotechnology",
"Business Administration",
"Business Logistics",
"Chemical Engineering",
"Chemistry",
"Children",
"Civil Engineering",
"Computer Engineering",
"Computer Science",
"Crime, Law, and Justice",
"Dance",
"Earth Sciences",
"Ethics",
"Economics",
"Electrical Engineering",
"Elementary Education",
"Engineering Science",
"English",
"Environmental Systems Engineering",
"Environmental Sciences",
"Environmental Resource Management",
"Film and Video",
"Finance",
"Food Science",
"Forest Science",
"Forest Technology",
"General Science",
"Geography",
"Geosciences",
"Graphic Design and Photography",
"Health and Physical Education",
"Health Policy and Administration",
"History",
"Horticulture",
"Hotel and Restaurant Management",
"Human Development & Family Studies",
"Individual and Family Studies",
"Industrial Engineering",
"Information Sciences and Technology",
"Journalism",
"Kinesiology",
"Landscape Architecture",
"Law Enforcement and Correction",
"Marine Biology",
"Marketing",
"Mathematics",
"Mechanical Engineering",
"Media Studies",
"Meteorology",
"Microbiology",
"Mineral Economics",
"Modern Languages",
"Music Education",
"Nuclear Engineering",
"Nursing",
"Nutrition",
"Philosophy",
"Physics",
"Physiology",
"Political Science",
"Politics",
"Pre-medicine",
"Psychology",
"Public Relations",
"Public Health",
"Real Estate",
"Recreation and Parks",
"Rehabilitation Services",
"Religious Studies",
"Secondary Education",
"Sociology",
"Social Work",
"Special Education",
"Speech Communication",
"Statistics",
"Telecommunications",
"Theater",
"Wildlife and Fishery Science",
"Wildlife Technology",
"Gender Studies",
"Energy"
];
10 changes: 10 additions & 0 deletions src/data/wrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = [
'Updated $1',
'Intro to $1',
'$1 101',
'$1 in depth',
'Dive into $1',
'Integrated $1',
'$1 Theory',
'New $1'
]
Loading

0 comments on commit aa64c15

Please sign in to comment.