Gem #wedding_s

Gem #wedding_s

Bf7ce9b68bbb0058721906b4db15b9b5?s=128

Kei Shiratsuchi

October 21, 2013
Tweet

Transcript

  1. 2.
  2. 3.
  3. 4.

    (FN

  4. 5.
  5. 6.
  6. 8.

  7. 11.
  8. 12.

  9. 14.
  10. 15.

    nokogiri require 'nokogiri' require 'open-uri' html = open('https://twitter.com/kei_s') doc =

    Nokogiri::HTML(html) doc.css('.tweet-text').each do |e| puts e.text end
  11. 16.

    nokogiri ࣗ୐࡞ۀEBZ !FJLPN͋Γ͕ͱ͏͍͟͝·͢ʂ ఱؾྑ͍Ͱ͢ XJUIZVLBBUࡾܢԂ 4BOLFJFO(BSEFO <QJD>ŠIUUQTQBUIDPNQ). ே͝͸Μ͔ͬ͠Γ৯΂ͨ ͸ʔɺNBDͷPQFOίϚϯυͷBΦϓγϣϯศརͩͬͨ͠[TIͷิ׬ͰBQQΛީิʹͯ͠ WJNZUVUPSͳ͍ͷ

    4BJOU1FQTJͷCBOEDBNQͷΞϧόϜ͕͜ͱ͝ͱ͘ങ͑ͳͯ͘ࠔΔ !TIJSBZVDB͋ʔͬɺ͸͍ʜʂ !GSLPVU͸ʔ͍͋Γ͕ͱ͏ʂ·ͨͶʙ !GSLPVU͸͍͸ʔ͍ʂਲͬͯΔ͠ձ͍͍ͨͥʂ !GSLPVU΋࣌͠Ҏ߱ʹҿΜͰͨΒͥͻҿ΋͏ͥʙɻҿΊΔʁ !GSLPVU!TIJSBZVDB͍ΔΑ OHJOYXMVB΍ͬͯΈ͚ͨͲ͍͚Δ͔ͳ !TIJSBZVDBͳΜͱ ೋਓ͚ͯͬ͜͠͏͓ञҿΜͰ͓Ոʹؼ͖ͬͯͨΒɺਲͬͯΔײ͋Δͻͱ͕ɺʮ΋ʔɺࠃഁΕͯ
  12. 17.

    (FN

  13. 19.
  14. 21.

    Gemfile # A sample Gemfile source "http://rubygems.org" gem "gems" gem

    "sqlite3" gem "sequel" gem "activerecord" gem "awesome_print" gem "tapp" gem "gnuplot"
  15. 22.
  16. 23.
  17. 26.
  18. 30.

    w geminaboxΛ࢖ͬͯϩʔΧϧϚγϯʹgemαʔόΛཱͯΔɻ w ϚϧνόΠτͷ໊લͷgemΛ࡞Δɻ۩ମతʹ͸gemspecϑΝΠϧ ͚ͩ࡞ͬͯϏϧυ͢Δɻ w bundleίϚϯυ͕ϚϧνόΠτ໊ͷgemΛ૝ఆͯ͠ͳ͍ͷͰϞϯ ΩʔύονΛ౰ͯΔɻ w GemfileΛinstance_eval͢Δࡍʹɺgemϝιουʹ౉Δจ

    ࣈྻΛforce_encoding(“UTF-8”) ͢Δɻ w gem αʔόʹґଘؔ܎ͷϦΫΤετΛ౤͛Δࡍʹ spec_file_name Λ URI.encode ͢Δɻ w gem ϥΠϒϥϦ͕ϚϧνόΠτ໊ͷ gem Λ૝ఆ͍ͯ͠ͳ͍ͷͰϞ ϯΩʔύονΛ౰ͯΔɻ w gem αʔό͔Βμ΢ϯϩʔυ͢ΔϦΫΤετΛ౤͛Δࡍʹ gem_file_name Λ URI.encode ͢Δɻ w geminabox ΋ϚϧνόΠτ໊ͷ gem Λ૝ఆ͍ͯ͠ͳ͍ͷͰϞϯΩ ʔύονΛ౰ͯΔɻ w ϦΫΤετΛ URI.decode ͯ͠ਖ਼͍͠ϑΝΠϧύεʹ͢Δɻ