Git Product home page Git Product logo

pybot-todolist-notify's Introduction

Source Code Pybott ทำ TODO List notify ภายในไม่กี่ขั้นตอน

ScreenShot

วิธีการใช้งานเบื้องต้น

  1. cmd > git clone https://github.com/Puttipong1234/PYBOTT-TODOLIST-NOTIFY
  2. สร้าง virtual env
python -m venv venv (use python 3.6.8 - 3.6.10)
  1. activate virtual evironment
(window : venv\Scripts\activate / mac : source venv\bin\activate)
pip install -r requirements.txt
  1. สร้าง Google sheet ของท่าน ตามตัวอย่างดังนี้ https://docs.google.com/spreadsheets/d/1lazyX90x7dRpIV84QhKxKZH0QFN2J-x0P9N_hh1e3hA/edit?usp=sharing โดยให้ header ตรงตามหัวข้อ (อย่าลืม Freeze header ไว้ด้วยนะ ให้มันอยู่แถวที่ 1 ตลอด)

  2. เก็บ Spreadsheet_key ของท่านไว้ ดังภาพ ScreenShot

  3. เปิดการใช้งาน API ของ Google sheet เข้าไปที่ google cloud console (ไม่สอนแล้วเด้ออ.. ดูโพสเก่าเอานะ หรือ หา Resource การเปิดใช้งาน google sheet api ได้ง่ายๆตาม google เลย)

  • ScreenShot

  • ตย. Service Account ScreenShot

  • เก็บไฟล์ credentails.json ไว้นะครับ เราจะนำเนื้อหาในไฟล์ไปใส่ไว้ใน env variable ของขั้นตอนที่ 9

  1. เปิดการใช้งาน Line Notification (ไม่สอนแล้วเด้ออ.. หา Resource ได้ง่ายๆตาม google เลย)

    • ScreenShot
    • สร้างกลุ่ม แล้วแอดเจ้า notify เข้าไป ผ่าน browser จากนั้น เก็บ Token ของกลุ่มเอาไว้นะครับ
  2. เรียบร้อย deploy to heroku (install git scm & heroku cli ก่อนเนอะ) เสจแล้วพิมพ์ใน command line ของโปรเจคได้เลยจร้า

    heroku create
    
    #จะได้ git repo ของ heroku มา copy ไว้แล้วพิมพ์ต่อเลยยย
    
    git init
    git add .
    git commit -m "first commit"
    git remote add heroku <ใส่ชื่อ repo heroku ได้เลย>
    
    heroku ps:scale clock=1
    
  3. ไปที่หน้า console ของ app-heroku ที่เราได้สร้างไว้แล้วไปที่ settings จากนั้นเพิ่ม environment variable ลงไปดังนี้ (เอาตามของที่ตนเองเก็บไว้นะครับ... ยกเว้นตัวแปรบนสุดจะให้ตั้งเป็น google-credentials.json)

  4. deploy โล้ด เสร็จแบล้วววว!!

    git push heroku master
    

    อย่าลืม commend ฟังชั่นที่ทดสอบทุกๆ30 วินาทีออกด้วยนะจะ

    เราจะได้ผลลัพธ์ออกมาประมาณนี้เลย ScreenShot

notes: หากเกิดข้อผิดพลาดทดลองคำสั่ง

```
heroku logs --tail
```

เพื่อดูว่าเกิดอะไรขึ้นเนอะ หรือจะไปที่ เว็บ console ของ heroku ก็ได้เช่นกัน
โดยไปที่ more > View logs
  • ScreenShot

ฝากติดตาม กดไลค์ กดแชร์ คอนเทน เพื่อเป็นกำลังใจแก่ทีมงานด้วยนะครับขอบพระคุณอย่างสูง

pybot-todolist-notify's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.