28 Jan '15, 10am

Reading... 【スクレイピングなし!】Rubyのgemで株価取得が超簡単だった。 | Project name by

Reading... 【スクレイピングなし!】Rubyのgemで株価取得が超簡単だった。 | Project name by

# 必要なgemをrequire。なおppはrubyにデフォルトで入っているので読み出すだけでOKです。 require 'jpstock' require 'pp' # ある企業の[今日の]4本値を取得してみる。なお28日に実行しました。 stock = JpStock.price(:code => 7203) # 世界のTOYOTAにご登場願います。 # とりあえずstockの中身を見てみる。 pp stock # その出力結果 # #<JpStock::PriceData:0x007ff70a910088 # @close=7811.0, # @code="7203", # @date=#<Date: 2015-01-28 ((2457051j,0s,0n),+0s,2299161j)>, # @high=7818.0, # @low=7750.0, # @open=7755.0, # @volume=6272600.0> # stockに収められているデータからほしいものをget pp stock.open # 初値 #=>7755.0 pp stock.close # 終値 #=>7811.0 pp stock.high # 高値 #=>7818.0 pp stock.low # 安値 #=>7750.0 pp stock.volume # 出来高 #=>6272600.0 # 続いて過去のデータを取得してみる。 hazimeno_hi = Date.parse("2015-01-20") # 2015/1/20から取得してみる。 stocks = JpStock.historical_prices( :code => 7203, :start_date => hazimeno_hi, # 指定した日から、 :end_date => Date.today # 今日まで。 ) # 複数の日程の4本値を取得したので、上述したstockが配列で複数個取得出来ているはず。 # ということで中身を見てみる。 pp stocks # その出力...

Full article: http://vsanna.sakura.ne.jp/wp/2015/01/stock_price_ruby/

Tweets

27 End User Domain Name Sales

domainnamewire.com 29 Jan '15, 4pm

A weekly run-down of end user domain name sales at Sedo. Sedo’s top reported sale last week was SuperSeats.com, which Mich...

OCTA's streetcar project moves to next level.

metro-magazine.com 27 Jan '15, 5pm

A proposed Calif. streetcar in the cities of Santa Ana and Garden Grove took a step forward when the Santa Ana City Counci...

SpaceX Raises $1 Billion from Google and Fidelity for Satellite Internet Project

SpaceX Raises $1 Billion from Google and Fideli...

spectrum.ieee.org 27 Jan '15, 4pm

SpaceX recently announced plans to provide Internet access through a global network of about 4,000 satellites starting wit...

LeadPages is a Reverse Domain Name Hijacker

domainnamewire.com 29 Jan '15, 7pm

WIPO panel finds that lead generation technology company abused UDRP. A three person World Intellectual Property Organizat...

PSA Shelves Hybrid Air Project While Awaiting New Partners

PSA Shelves Hybrid Air Project While Awaiting N...

hybridcars.com 27 Jan '15, 5am

PSA/Peugot-Citroën is putting its Hybrid Air project on hold, though the company said the move is only temporary until new...

Shams 1 — Largest CSP Project In Middle East — Performing Better Than Expected #cleantech

Shams 1 — Largest CSP Project In Middle East — ...

cleantechnica.com 26 Jan '15, 11am

The power generated from the power plant is sold to Masdar City through a 25-year power purchase agreement (PPA). While th...

New ccTLDs may have to block name collisions

domainincite.com 26 Jan '15, 2pm

New ccTLDs may have to block name collisions Kevin Murphy , January 26, 2015, 14:58:35 (UTC), Domain Registries ICANN is t...

'Datum Jelatek property project offered to inve...

therakyatpost.com 25 Jan '15, 1pm

Almost 1,000 people including residents from Taman Keramat here staged a protest to press for Datum Jelatek development pr...