Giter Club home page Giter Club logo

moon-bot-facebook's Introduction

Facebook Messenger Bot Chat for Moon

Moon Báo Giá

Cấu trúc object Website

WEBSITENAME: {

  • TAX : 0.083, // Thuế Mỹ của web
  • MATCH : "domain.com", // Match domain thì sẽ bắt đầu process
  • NAME : "WebName", // [optional] Tên hiển thị khi gọi getAvailableWebsite
  • SILENCE : true, // Nếu có SILENCE == true thì khi không lấy được giá sẽ im lặng không trả lời (dành cho web có check captcha)

Option khác

  • RATE : "EUR", // [optional] Quy đổi ngoại tệ. Default ko có thì sẽ là USD
  • COOKIE : "session-id=12345", // [optional] Dùng khi web cần cookie để lưu region

Lấy thông tin Price Case 1: Lấy priceBlock trong source bằng selector

  • PRICEBLOCK : ["#priceBlock"], // Array chứa id/class các block chứa Giá

Case 2: Nếu ko có priceBlock thì sẽ xét tới json để lấy giá

  • JSONBLOCK : {
    • SELECTOR : "#scriptBlock", // [optional] Case 1: Nếu json được lưu ở block có id thì có thể dùng Selector
    • INDEX : 0, // Case 2: Nếu json lưu ở vị trí index cố định thì sẽ lấy ra index đó
    • KEYWORD : "masterData", // [optional] Case 3: Nếu json ko có vị trí cố định thì sẽ dò theo keyword xuyên suốt các block
    • REGEX : /{[.+}/gm, // Nếu trong script là 1 đoạn code js rồi mới có JSON thì dùng regex để lấy phần json ra
    • PATH : ["$.price"] // Lấy ra element theo format của jsonpath }

Lấy thông tin Category & Weight: Case 1: Category & Weight nằm chung block

  • DETAILBLOCK : ["#detailBlock"], // [optional] Case 1: Array chứa id/class các block chứa Detail Weight & Category (hiện chỉ có Amazon)

Case 2: Category & Weight nằm riêng block

  • CATEGORYBLOCK : ["#categoryBlock"], // [optional] Array chứa id/class các block chứa Category

  • WEIGHTBLOCK : ["#weightBlock"], // [optional] Array chứa id/class các block chứa Weight

  • REDIRECT : ["#redirectLink"] // [optional] Array chứa id/class các block chứa link để redirect sang 3rd party (hiện chỉ có Amazon) }

Cấu trúc object Category

GENERAL: {

  • ID : "GENERAL", // Id của category
  • SHIP : 8.5, // Giá ship về VN tính theo $/kg

Phụ thu theo cái VD: giá từ 0-$10 phụ thu $7, giá từ $10+ phụ thu $9 thì [extra = 7, priceExtra = 2, priceAnchor = 10]

  • EXTRA : 0, // Phụ thu tính theo $/cái
  • PRICEEXTRA : 0, // Phụ thu cộng thêm vào Extra khi giá >= PriceAnchor
  • PRICEANCHOR : 0,

Phụ thu theo %

  • HVEXTRA : 0.1 // Phụ thu Giá Trị Cao tính theo %, chỉ cộng khi giá >= HVAnchor
  • HVANCHOR : 500, // Mức sàn để phụ thu Giá Trị Cao tính theo $
  • NAME : "thông thường", // Tên category
  • NOTE : "Phí ship $8.5/kg", // Note để chú thích khi xuất response

Xét stringCategory của web, nếu có trong keyword và không có trong notKeyword thì chọn Category này

  • KEYWORD : [],
  • NOTKEYWORD : []

},

moon-bot-facebook's People

Contributors

inuris avatar

Watchers

 avatar James Cloos avatar

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.