Skip to content

Commit

Permalink
Replace g0v.hackpad.com with g0v.hackpad.tw for #22
Browse files Browse the repository at this point in the history
  • Loading branch information
caasi committed Aug 1, 2017
1 parent b868e77 commit cd43b14
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
template: ''
},
HACKPAD: {
site: 'g0v.hackpad.tw',
client_id: '',
secret: '',
template: ''
Expand Down
6 changes: 5 additions & 1 deletion js/hackpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ var config = require('../config');
var Hackpad = require('hackpad');
var cheerio = require('cheerio');

var client = new Hackpad(config.HACKPAD.client_id, config.HACKPAD.secret, { 'site': 'g0v' });
var client = new Hackpad(
config.HACKPAD.client_id,
config.HACKPAD.secret,
{ 'site': config.HACKPAD.site || 'g0v.hackpad.tw' }
);

var padNum = process.argv[2];
var padName = process.argv[3];
Expand Down
4 changes: 3 additions & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const dummy = {
var app = new Koa()
var router = new Router()

config.HACKPAD.site = config.HACKPAD.site || 'g0v.hackpad.tw'

router
.get('/', (ctx) => {
ctx.status = 204
Expand Down Expand Up @@ -69,7 +71,7 @@ router
const padID = stdout.split('\n').slice(-2)[0]

ctx.status = 201
ctx.body = { url: `https://g0v.hackpad.com/${padID}` }
ctx.body = { url: `https://${config.HACKPAD.site}/${padID}` }
})
.post('/spreadsheet', async (ctx) => {
const times = ''
Expand Down
4 changes: 3 additions & 1 deletion js/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var hackfoldr = require('./hackfoldr');
var typeform = require('./typeform');
var exec = require('child_process').exec;

config.HACKPAD.site = config.HACKPAD.site || 'g0v.hackpad.tw';

/* next Saturday */
var default_start_moment = moment.natural('09:00 next saturday');
default_start_moment = default_start_moment.natural('+7d');
Expand Down Expand Up @@ -107,7 +109,7 @@ inquirer.prompt(questions).then(function (answers) {

exec(cmd, function(err, stdout, stderr) {
var padID = stdout.split('\n').slice(-2)[0];
console.log('建完 hackpad 啦... https://g0v.hackpad.com/' + padID);
console.log('建完 hackpad 啦... https://' + config.HACKPAD.site + '/' + padID);
console.log('--------');

console.log('建立 Google Spreadsheet...');
Expand Down
18 changes: 9 additions & 9 deletions tmpl/ethercalc.sc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cell:A2:vtc:::
cell:B2:t:g0v${name}共筆
cell:C2:vtc:::
cell:D2:vtc:::
cell:A4:t:https\c//g0v.hackpad.com/${padID}
cell:A4:t:https\c//g0v.hackpad.tw/${padID}
cell:B4:t:${begin_at} 活動資訊
cell:C4:vtc:::
cell:D4:t:行前準備\cimportant
Expand All @@ -41,7 +41,7 @@ cell:A7:vt:tl:http\c//join.g0v.today
cell:B7:t:slack聊天室
cell:D7:t:pink 同步 irc
cell:E7:t:pink red green blue
cell:A8:t:https\c//g0v.hackpad.com/2mprMIpYMz9
cell:A8:t:https\c//g0v.hackpad.tw/2mprMIpYMz9
cell:B8:t:與會守則 COC
cell:C8:vtc:::
cell:D8:t:行前請讀
Expand All @@ -58,7 +58,7 @@ cell:A11:vt:tl:${spreadsheet_link}
cell:B11:t:要提案!看提案!
cell:C11:vtc:::
cell:D11:t:提案在這登記\cwarning
cell:A12:t: https\c//g0v.hackpad.com/g0v--JWIizPuN3mz
cell:A12:t: https\c//g0v.hackpad.tw/g0v--JWIizPuN3mz
cell:B12:t:g0v提案流程參考
cell:C12:vtc:::
cell:D12:vtc:::
Expand All @@ -76,7 +76,7 @@ cell:A15:vtc:::
cell:B15:t:黑客松初心者
cell:C15:t:{"expand"\ctrue}
cell:D15:vtc:::
cell:A16:t: https\c//g0v.hackpad.com/FAQ-gLNXqwv6krA
cell:A16:t: https\c//g0v.hackpad.tw/FAQ-gLNXqwv6krA
cell:B16:t:黑客松FAQ
cell:C16:vtc:::
cell:D16:vtc:::
Expand Down Expand Up @@ -104,22 +104,22 @@ cell:A22:vtc:::
cell:B22:t:空白模版
cell:C22:t:{"expand"\cfalse}
cell:D22:vtc:::
cell:A23:t: https\c//g0v.hackpad.com/Project-Readme-aCZGg48I5pX
cell:A23:t: https\c//g0v.hackpad.tw/Project-Readme-aCZGg48I5pX
cell:B23:t:專案介紹空白模版
cell:C23:vtc:::
cell:D23:t:常用\cimportant
cell:F23:t:done
cell:A24:t: https\c//g0v.hackpad.com/Product-Planning-T2d2kAradat
cell:A24:t: https\c//g0v.hackpad.tw/Product-Planning-T2d2kAradat
cell:B24:t:產品規劃空白模版
cell:C24:vtc:::
cell:D24:vtc:::
cell:F24:t:done
cell:A25:t: https\c//g0v.hackpad.com/User-Story-Socialtext-Style-mvxkbtlXlDf
cell:A25:t: https\c//g0v.hackpad.tw/User-Story-Socialtext-Style-mvxkbtlXlDf
cell:B25:t:user story 空白模版
cell:C25:vtc:::
cell:D25:vtc:::
cell:F25:t:done
cell:A26:t: https\c//g0v.hackpad.com/dwimzocKjEL
cell:A26:t: https\c//g0v.hackpad.tw/dwimzocKjEL
cell:B26:t:免責聲明模版
cell:C26:vtc:::
cell:D26:vtc:::
Expand Down Expand Up @@ -150,7 +150,7 @@ cell:A32:vtc:::
cell:B32:t:專案 hackpad 請加到這裡
cell:C32:t:{"expand"\ctrue}
cell:D32:t:較完整專案\cimportant
cell:A33:t:https\c//g0v.hackpad.com/COSCUP-2015--WxxpYVpXOWA
cell:A33:t:https\c//g0v.hackpad.tw/COSCUP-2015--WxxpYVpXOWA
cell:B33:t:COSCUP野生官網(範例)
cell:C33:vtc:::
cell:D33:vtc:::
Expand Down

0 comments on commit cd43b14

Please sign in to comment.