Skip to content

Instantly share code, notes, and snippets.

@tonytonyjan
Last active March 23, 2026 09:50
Show Gist options
  • Select an option

  • Save tonytonyjan/fe0848997a038ca84081d4664a1f519f to your computer and use it in GitHub Desktop.

Select an option

Save tonytonyjan/fe0848997a038ca84081d4664a1f519f to your computer and use it in GitHub Desktop.

Revisions

  1. tonytonyjan revised this gist Oct 15, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion chunghwa_post
    Original file line number Diff line number Diff line change
    @@ -37,5 +37,5 @@ jq -n -c --arg mailNO "$1" '{
    },
    body: { MAILNO: $mailNO, pageCount: 10 }
    }' |
    curl -sSL 'http://postserv.post.gov.tw/pstmail/EsoafDispatcher' --data @- |
    curl -sSL 'https://postserv.post.gov.tw/pstmail/EsoafDispatcher' --data @- |
    jq '.[0].body.host_rs.ITEM | map({datetime: .DATIME, status: .STATUS, station: .BRHNC})'
  2. tonytonyjan created this gist May 21, 2019.
    41 changes: 41 additions & 0 deletions chunghwa_post
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    #!/bin/sh

    test $# != 1 && cat <<USAGE && exit 1
    Usage: $0 MAIL_ID
    == Output Example ==
    [
    {
    "datime": "20190520195647",
    "status": "運輸途中           ",
    "station": "台北中心掛號函件股 "
    },
    {
    "datime": "20190520172500",
    "status": "交寄郵件           ",
    "station": "臺北螢橋郵局    "
    }
    ]
    USAGE

    jq -n -c --arg mailNO "$1" '{
    header: {
    InputVOClass: "com.systex.jbranch.app.server.post.vo.EB500100InputVO",
    TxnCode: "EB500100",
    BizCode: "query2",
    StampTime: true,
    SupvPwd: "",
    TXN_DATA: {},
    SupvID: "",
    CustID: "",
    REQUEST_ID: "",
    ClientTransaction: true,
    DevMode: false,
    SectionID: "esoaf"
    },
    body: { MAILNO: $mailNO, pageCount: 10 }
    }' |
    curl -sSL 'http://postserv.post.gov.tw/pstmail/EsoafDispatcher' --data @- |
    jq '.[0].body.host_rs.ITEM | map({datetime: .DATIME, status: .STATUS, station: .BRHNC})'