Coder Social home page Coder Social logo

rxgo-examples's Introduction

何?

ReactiveXのGo版である、RxGoを使ってみたサンプル集です

サンプル

メイン 概要
csv_parser 入力csvの指定したカラムのみ標準出力に出力する
web_watcher 指定URLの指定要素を定期的に監視して、更新分をslackに通知する

csv_parser

概要

入力csvの指定したカラムのみ標準出力に出力する

使い方

オプション 説明
C 出力カラム(カンマ区切り)
t tsvの場合、指定する
% bin/mac/csv_parser -h
Usage of bin/mac/csv_parser:
  -C string
        display columns
  -t    tsv

実行例(osx)

curl http://hojin.ctot.jp/markets/CSV/01_USDJPY_D.csv | \
nkf -w | \
bin/mac/csv_parser -C 1,3

web_watcher

概要

指定URLの指定要素を定期的に監視して、更新分をslackに通知する

使い方

オプション 説明 デフォルト
t 監視するページ -
c ページの文字コード utf-8
e 監視する要素 -
a 取得する属性 text
s 監視する間隔(秒) 10
p postするslackのincoming-webhook url -
% bin/mac/web_watcher -h
Usage of bin/mac/web_watcher:
  -a string
        target attribute (default "text")
  -c string
        target charset (default "utf-8")
  -e string
        target element
  -p string
        slack incoming hook url
  -s int
        access duration[second] (default 10)
  -t string
        target url

実行例(osx)

# ライブドアニュースのタイトルを300秒に一回取得し、更新分をslackに通知する
bin/mac/web_watcher \
-t "http://news.livedoor.com/" \
-c "euc-jp" \
-e "ul.topicsList > li" \
-s 300 \
-p "https://hooks.slack.com/services/hogehoge"

rxgo-examples's People

Stargazers

 avatar  avatar

Watchers

 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.