8월, 2016의 게시물 표시

Saving data - Firebase Database REST API

이미지
Using a Firebase app secret in apps script 에 이어서 Apps script를 사용하여 Database에 data를 저장해 봤습니다. 참조: Installation & Setup for REST API - Firebase Database Saving Data - Firebase database REST apps script code :  https://github.com/eojji/Apps-script-and-Firebase-Database apps script - Index.html 브라우저에서  Apps script web app  실행 Firebase Database 결과: https://eojjigas.firebaseio.com/

Using a Firebase app secret in apps script

이미지
Google apps script에서 Firebase app secret을 사용하여 OAuth Authorization Flow 없이 Database를 사용할 수 있습니다. Firebase console 에서 새 프로젝트 만들기버튼으로 eojjiGas 프로젝트를 생성했습니다. eojjiGas 프로젝트에서 설정 버튼 클릭하고 데이터베이스 탭에서 비밀번호를 복사합니다. 아래 참고 자료 중  Real-time notifications in add-ons with Firebase 를 보고 Google Apps script 프로젝트를 만듭니다. Google Apps script 에디터 메뉴 중 파일 선택 후 프로젝트 속성 클릭 Google Apps script 에디터 메뉴 - 파일 - 프로젝트 속성 - 스크립트 속성 - fb-secret 속성 추가 : 값은 위에서 복사한 데이터베이스 비밀번호 Google Apps script 에디터 메뉴 게시- 웹 앱으로 배포 Google Apps script 에디터 메뉴 게시- 웹 앱으로 배포 - 앱을 실행할 사용자: 웹 앱을 액세스하는 사용자로 설정 현재 웹 앱 URL:  https://script.google.com/a/macros/eojji.com/s/AKfycbwoTCNtB4NlDIyXs3jipJrZKSvOYDv69abyWtwetdRJFwO1QGbX/exec firebase - 데이터베이스 - 데이터 공유앨범: https://goo.gl/photos/7jvEtJB8dUYiSs3NA 참고 자료: https://developers.google.com/apps-script/overview#your_first_script https://developers.google.com/apps-script/guides/web https://developers.google.com/

Share a Google Form as “View Only”

이미지
Google Form을 보기 가능으로 공유하려고 했는데 실패했습니다. Tutorial: Expense Report Approval - Simple workflow application 에서 복사한 시트를 참조하여 Form을 만들고 이것을 보기 가능으로 공유하려고 했는데 안됩니다. 참조한 사이트는 아래와 같습니다. http://www.coffeenancy.com/2015/04/share-a-google-form-as-view-only/ At the top of your form, click the View responses button. view responses When the spreadsheet opens, click the blue Share button and add your collaborators, giving them view only access. Instruct them to make their own copy of the spreadsheet. Once they have opened their copy of your spreadsheet, all they have to do is go to the Form menu and select Edit form. This will give them access to their copy of your original form, which they can edit and change to meet their own needs. https://developers.google.com/apps-script/articles/expense_report_approval Section 1: Setting up the Expense Report Form OPEN TEMPLATE SPREADSHEET 위의 링크를 사용하여 열린 구글 스프레드시트에 Form 메뉴가 없습니다. 그래서 Form을 만들고 위의  Share a Google Form as “View

[test] Tutorial: Expense Report Approval

이미지
Tutorial: Expense Report Approval - Simple workflow application 에서 만든 지출 품의서를 테스트합니다. Tutorial: Expense Reports 설문지 보내기 Expense Reports - form 설정 form 설정 - 사용자 제한 체크 해지 Expense Reports - form - 설문지 보내기 https://goo.gl/forms/7rvMU3Te3R5qVx7u1 Tutorial Expense Reports 폼 응답 Tutorial: Expense Reports sheet 결과 Timestamp Email Address Amount Description Manager's Email Address 8/17/2016 3:41:54 khs@eojji.net 50000 test khs@eojji.net 8/17/2016 20:33:02 backup@eojji.net 3000 테스트 ㅁㅁㅁ a@eojji.com Tutorial: Expense Reports - Script Trigger 설정 리소스 - 현재 프로젝트의 트리거 리소스 - 트리거 - onReportOrApprovalSubmit 프로젝트 속성 - 시간대 (GMT+09::00) 서울 Manager's Email - Expense Report Approval Request email - Expense Report Approval Request Tutorial Expense Report Approvals email - Expense Report Approval Request - 링크 클릭 form Tutorial Expense Report Approvals 응답

Tutorial: Expense Report Approval - Simple workflow application

이미지
Tutorial: Expense Report Approval 위의 사이트를 참조하여 지출 품의서를 만들어 봤습니다. Section 1: Setting up the Expense Report Form의 spreadsheet template에 폼이 없어서 만드는 과정만 추가 되었습니다. 나머지는 사이트의 설명을 따라하면 됩니다. Section 1: Setting up the Expense Report Form Tutorial Expense Reports - 파일 - 사본 만들기 Tutorial Expense Reports - 삽입 - 설문지 Tutorial Expense Reports - 삽입 - 설문지 편집 Tutorial Expense Reports - 설문지 - 현재 설문지로 이동 Tutorial Expense Reports - 설문지 - 현재 설문지 - 응답 Tutorial Expense Reports - 응답 보기 Section 4: Running the example script 4. As an administrator, manually run again the script  onReportOrApprovalSubmit . Notice how in the expense reports spreadsheet the 'State' column for your expense report changes to 'APPROVED' or 'DENIED'. expense report approval - 실행 - onReportOrApprovalSubmit 운영하기:  [test] Tutorial: Expense Report Approval

Connect a Custom Domain - Firebase Hosting

이미지
Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API 를 참조하여 웹 앱을 만들고 Firebase에 호스팅했습니다. 호스팅 과정은  Eojji log using firebase hosting 을 참조하세요. Google Apps script로 만든 웹 앱이라서 실행하면 Error 400 (OAuth2 Error)가 발생합니다. 이때 웹 앱의 개발자 콘솔에서 자바스크립트 원본에 새로 만든 주소를 등록해야 합니다. https://app.eojji.com Firebase로 연결되도록 도메인의 DNS 레코드를 업데이트하세요. CNAME 레코드는 Firebase 앱 도메인에 도메인 이름의 별칭을 지정합니다. 도메인 등록기관에서 업데이트된 레코드를 전파하면 사이트의 서비스가 개시됩니다. 하위 도메인 리디렉션 호스트 : app.eojji.com 레코드 : eojjilog.firebaseapp.com 브라우저에서 사이트로 이동하면 권한을 묻는 과정에서 Error 400 (OAuth2 Error) 같은 오류가 발생한다면 승인된 자바스크립트 원본에 맞춤 도메인을 추가해 주세요. Setting up OAuth 2.0 - Google API Console Help Authorize access to Google Apps Script Execution API 400. That’s an error. Error: origin_mismatch Application: Log using sheet 개발자 console - 사용자 인증 정보 - 웹 애플리케이션용 클라이언트 ID - 승인된 자바스크립트 원본 -  https://app.eojji.com 추가 게시물 관련 이미지 앨범:  https://goo.gl/photos/8JMqv9ajmR9K2UWGA

Eojji log using firebase hosting

이미지
방명록 Firebase hosting :  https://app.eojji.com/   작업순서 Google Apps script로 웹에서 name과 comment를 입력 받아 Google sheet에 저장하는 기능을 만들었습니다. 이 기능을 Execution API로 배포했습니다. Firebase Hosing에서 사용합니다. source code:  https://github.com/eojji/Firebase-hosting-and-Google-apps-execution 참조 :  Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API. 참조:  Firebase Hosting with Apps Script using Execution API Firebase eojji log app 실행 Google spreadsheet에 저장 Firebase 프로젝트 만들기:  https://console.firebase.google.com/ Firebase Hosting Firebase init 맞춤 도메인 사용자가 사이트를 방문할 때 표시할 정확한 도메인 이름을 입력하세요. 루트 도메인(yourdomain.com)이나 하위 도메인(www.yourdomain.com 또는 app.yourdomain.com)일 수 있습니다. 도메인의 소유권을 확인하려면 제공된 값을 사용하여 도메인 도메인 등록기관에 다음 TXT 레코드를 추가하세요. 도메인을 확인하는 데 최대 24시간이 걸릴 수 있습니다. 확인이 완료되면 이메일 알림이 전송됩니다. 처음에 log.eojji.com을 신청하고 TXT 레코드를 추가했지만 오류가 났습니다. app.eojji.

Firebase Hosting with Apps Script using Execution API

이미지
Firebase hosting app - eojjisheet Hosting Site: https://eojjisheet.firebaseapp.com 방명록 기능입니다. 이메일이 기록됩니다. firebase hosting app - eojjisheet - 링크가 있는 모든 사용자가 수정할 수 있음 firebase hosting app - eojjisheet - API 실행 가능으로 배포 - 모든 사용자 웹에서 name과   comment를 입력 받아서 Google sheet에 저장하는 기능을  Firebase에 Hosing했습니다. Google Sheet의 Apps script 함수를 웹에서 호출할 수 있도록  Execution API로 배포합니다. Firebase Hosing에  Execution API를 호출하는  index.html을 upload하였습니다. Google 로그인이 필요합니다. Authorize access to Google Apps Script Execution API  Google Sheets as a Database – Authenticated INSERT에서 다음을 요청합니다. Google에서 내 정보 확인 내 이메일 주소를 봅니다. Google 드라이브에서 스프레드시트 보기 및 관리 참조: Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API Create a Target Project for the Apps Script Execution API Before you can begin any of the quickstarts, you will need a target Apps Script for the API to call. Follow these steps to create a simp

Firebase Hosting eojjiFolder

이미지
Firebase Hosting | Firebase Firebase Hosting provides fast and secure static hosting for your web app. Next Steps: Get Started with Hosting and deploy your web app or static assets. https://console.firebase.google.com/ console.firebase - 프로젝트 만들기 - eojjiFolder console.firebase - eojjiFolder - Hosting console.firebase - eojjiFolder - Hosting - 설정 호스팅 설정  사이트를 호스팅하려면 npm(Node.js)을 사용해 Firebase 명령줄 도구를 설치해야 합니다. Firebase 도구 설치 코드: $ npm install -g firebase-tools 명령어가 작동하지 않나요? npm 권한을 변경 해야 할 수도 있습니다. 참조: Firebase CLI Reference https://nodejs.org/en/download/ console.firebase - eojjiFolder - Hosting - cmd console.firebase - eojjiFolder - Hosting - 배포 C:\Program Files\nodejs>firebase login Already logged in as a@eojji.com C:\Program Files\nodejs>firebase init     ######## #### ########  ######## ########     ###     ######  ########     ##        ##  ##     ## ##       ##     ##  ##   ##