Project

easycard

0.01
No commit activity in last 3 years
No release in over 3 years
台灣悠遊卡交易紀錄查詢工具,支援指令模式。 A search tool for Taiwan EasyCard, supporting CLI mode.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.6
~> 10.4
 Project Readme

注意:因悠遊卡公司於 5/12 關閉查詢功能,此工具已無法使用,詳見公告

Build Status

安裝

gem install easycard

使用指令

$ easycard -h
Usage: easycard CARD_ID [options]
    -m, --months=NUMBER              最近 n 月
    -d, --days=NUMBER                最近 n 天
    -j, --json                       以 JSON 格式顯示
    -y, --yaml                       以 YAML 格式顯示
    -f, --from=YYYY/MM/DD            起始時間
    -t, --to=YYYY/MM/DD              結束時間
    -h, --help                       顯示此訊息
$ easycard CARD_ID                         # 最近 1 個月的紀錄
$ easycard CARD_ID -j                      # 最近 1 個月的紀錄,以 JSON 呈現
$ easycard CARD_ID -m 3                    # 最近 3 個月的紀錄
$ easycard CARD_ID -d 3                    # 最近 3 天的紀錄
$ easycard CARD_ID -f 2015/4/4 -t 2015/5/5 # 從 4 月 4 日至 5 月 5 日的紀錄

使用 Ruby

require 'easycard'
response = EasyCard.query CARD_NUMBER
response.raw_data # 原始資料
response.data     # 陣列
response.to_s     # 表格字串
response.to_json  # JSON 格式的字串
response.to_yaml  # YAML 格式的字串

EasyCard.query CARD_NUMBER, from: Date.today-30, to: Date.today