Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby講義 第6回

Ruby講義 第6回

2012.5.17 Wikipediaアクセス解析(前編)

Kuniaki IGARASHI

May 18, 2012
Tweet

More Decks by Kuniaki IGARASHI

Other Decks in Technology

Transcript

  1. 8JLJQFEJBΞΫηε਺σʔλ KBC$ KBC$$#$"'$#'$#%$"$"$$"$$"' $#%$#$"$"'$#'$#%$"'$#'$#% $"'$#%$"$$"'$#%$"$$"$"%$"' $#'$#%$"'$#%$" KBC&&#&&&#&&""&% "&#&&"#&'&"&$"$@ &$#&@&#& KBC&"&"&"%&"

    &&"&"&"&&##&% &#@&%&#$&#'&"#&## &&"%&#&"&"' &&"& KBC&"&"&"%&" &&"&"&"&&##&% &#@&"&&#" &"&"&"%&" &&"&"&"&"'&'#$'   ͍ͬͯ͏σʔλ͕਺ेສߦ
  2. 8JLJQFEJBͷΞΫηε਺ղੳ FODPEJOHVUG SFRVJSFDHJ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' MJTU<> XIJMFUFYUpMFHFUT CFHJO

    OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE pMFDMPTF DPVOUॱʹιʔτ SFTVMUMJTUTPSU@CZEPcJc J<DPVOU>UP@J FOE τοϓදࣔ SFTVMUSFWFSTFpSTU  FBDIEPcJc QVUTJ FOE ߦ͘Β͍Ͱॻ͚·͢
  3. 8JLJQFEJBͷΞΫηε਺ղੳ SFRVJSFDHJ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB

    EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE pMFDMPTF ίʔυղઆ σʔλϑΝΠϧ໊ࢦఆ ϑΝΠϧ։͘ จࣈίʔυ65' ߦಡΈࠐΈ ֤ߦ͕UFYUʹ ֨ೲ͞Εͯશߦ܁Γฦ͠ ϑΝΠϧด͡Δ
  4. ϑΝΠϧΛ։͘ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' XIJMFUFYUpMFHFUT QVUTUFYU FOE pMFDMPTF 'JMFPQFOϝιουͰϑΝΠϧΛ։͖·͢ɻ

    ։͘σʔλΛಡΊΔঢ়ଶʹ͢Δ ։͍ͨ'JMFΦϒδΣΫτΛpMF΁୅ೖ͓͖ͯ͠·͢ɻ S65' S͸ಡΈࠐΈϞʔυࢦఆɻ SFBEͷҙɻ 65'͸จࣈίʔυࢦఆɻ
  5. ϑΝΠϧ͔Β֤ߦಡΈࠐΈ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' XIJMFUFYUpMFHFUT QVUTUFYU FOE pMFDMPTF pMFHFUTɿߦಡΈࠐΈ

    ɹಡΈࠐΊͨΒͦͷߦͷ಺༰Λฦ͢ ɹಡΈࠐΊͳ͔ͬͨΒOJMΛฦ͢ XIJMFFOEɿ৚ِ͕݅ GBMTF OJM ʹͳΔ·Ͱ܁Γฦ͠
  6. XIJMFจ pMFHFUTϝιου pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' XIJMFUFYUpMFHFUT QVUTUFYU FOE pMFDMPTF

    XIJMFUFYUpMFHFUT XIJMF৚݅੒ཱத͸܁Γฦ͠ ͜ͷ৔߹ɺ৚݅͸ UFYUpMFHFUT ʹͳΓ·͢ɻ pMFHFUT ͸ߦಡΈࠐΉϝιου ಡΈࠐΊͨΒਅɺ ϑΝΠϧऴ୺ͰಡΈࠐΊͳ͍ ͱِ OJM ʹͳΓ·͢ɻ XIJMFจ͸ ڭՊॻQ
  7. ϑΝΠϧ͔Β֤ߦಡΈࠐΈ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' XIJMFUFYUpMFHFUT QVUTUFYU FOE pMFDMPTF XIJMF৚݅੒ཱத͸܁Γฦ͠

    ͜ͷ৔߹ɺ৚݅͸ UFYUpMFHFUT ʹͳΓ·͢ɻ pMFHFUT ͸ߦಡΈࠐΉϝιου ಡΈࠐΊͨΒਅɺ ϑΝΠϧऴ୺ͰಡΈࠐΊͳ͍ ͱِ OJM ʹͳΓ·͢ɻ UFYUʹߦ໨ͷσʔλ͕ೖͬͯFOE·Ͱॲཧ XIJMFͷߦ΁໭Γɺ UFYUʹߦ໨ͷσʔλ͕ೖͬͯFOE·Ͱॲཧ શߦ܁Γฦ͠ ऴ୺ͰpMFHFUT͢Δͱ৚݅ෆ੒ཱʹͳΓ܁Γฦ͠ऴྃ
  8. 8JLJQFEJBͷΞΫηε਺ղੳ SFRVJSFDHJ pMFOBNFQBHFDPVOUT pMF'JMFPQFO pMFOBNF S65' MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB

    EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE pMFDMPTF σʔλϑΝΠϧ໊ࢦఆ ϑΝΠϧ։͘ จࣈίʔυ65' ߦಡΈࠐΈ ֤ߦ͕UFYUʹ ֨ೲ͞Εͯશߦ܁Γฦ͠ ϑΝΠϧด͡Δ
  9. 8JLJQFEJBͷΞΫηε਺ղੳ SFRVJSFDHJ pMFOBNFQBHFDPVOUT pMF'JMFPQFO pMFOBNF S65' MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB

    EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE pMFDMPTF ίʔυղઆ ೔ຊޠͷσʔλ͸ߦઌ಄͕KB ߦઌ಄͕KBͰͳ͔ͬͨΒύε OFYUɿ܁Γฦ͠தͷॲཧΛ࣍ͷσʔλʹਐΊΔ VOMFTTɿJGOPU UFYUd?KBਖ਼نදݱ KBC&&%
  10. OFYUจ XIJMFUFYUpMFHFUT  "  OFYU  #  FOE

    ܁Γฦ͠தʹOFYUจΛॻ͘ͱɺͦΕҎ߱ͷॲཧΛߦΘͣɺ ܁Γฦ͠ઌ಄ʹ໭͠·͢ɻ  " ͷ෦෼ͷॲཧ͕ߦΘΕͯOFYU΁͘Δͱɺ  # ͷ෦෼ͷॲཧ͸ߦΘΕͣɺ ܁Γฦ͠ઌ಄΁໭Γ·͢ɻ ڭՊॻQͷਤ͕෼͔Γ΍͍͢Ͱ͢ɻ ڭՊॻQ
  11. OFYU VOMFTT ਖ਼نදݱԋश σʔλϑΝΠϧEBUBUYUΛ࡞੒ͯ͠ɺ EBUBUYUͷશߦͷ͏ͪɺߦ಄͕#ͷߦ͚ͩΛදࣔ͢ ΔҎԼͷίʔυΛ࣮ߦ͍ͯͩ͘͠͞ɻ pMFOBNFEBUBUYU pMF'JMFPQFO pMFOBNF S65'

    XIJMFUFYUpMFHFUT OFYUVOMFTTUFYUd?# QVUTUFYU FOE pMFDMPTF "MJDF #PC $BSPM ˢEBUBUYUͷྫ ͳΜͰ΋0,Ͱ͢ ͕ɺ#࢝·Γͷߦ ͱɺͦ͏Ͱͳ͍ߦ Λ͍Ε͍ͯͩ͘͞
  12. 8JLJQFEJBͷΞΫηε਺ղੳ MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOU EBUB<>^

    MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE σʔλߦ͔ΒλΠτϧͱΧ΢ϯτΛऔಘ ਫ৭ͷͱ͜Ͱ΍ͬͯ·͢ɻ
  13. EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<>  DPVOUEBUB<>^ UFYUˠKBC&&% EBUBˠ<KBC &&%  >

    Iˠ\UJUMF͍Ζ DPVOU^ ͱ͋ΔߦͷλΠτϧͱΞΫηε਺͕ղੳͰ͖·ͨ͠ 8JLJQFEJBͷΞΫηε਺ղੳ
  14. 8JLJQFEJBͷΞΫηε਺ղੳ MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOU EBUB<>^

    MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE σʔλߦ͔ΒλΠτϧͱΧ΢ϯτΛऔಘ ਫ৭ͷͱ͜Ͱ΍ͬͯ·͢ɻ
  15. 8JLJQFEJBͷΞΫηε਺ղੳ MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII

    SFTDVF&YDFQUJPOF QF FOE FOE ֤ߦͷ੔ܗσʔλΛ"SSBZ΁٧ΊΔ ԫ৭ͷͱ͜Ͱ΍ͬͯ·͢ɻ MJTU<> ˠMJTUʹۭͷ"SSBZΛ୅ೖ MJTUQVTII MJTU "SSBZΦϒδΣΫτ ͷ࠷ޙʹIΛ௥Ճ
  16. ྫ֎ॲཧ MJTU<> XIJMFUFYUpMFHFUT CFHJO OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII

    SFTDVF&YDFQUJPOF QF FOE FOE ۩ମతʹ͸ɺ$(*VOFTDBQF͕ม׵Ͱ͖ͳ͍ঢ়گʹͳΔ৔߹ʹ ྫ֎Λൃੜ͠·͢ɻྫ֎ΛSFTDVFઅͰั·͑ͯɺྫ֎ͷ಺༰ F ΛQϝιουͰը໘ʹදࣔ͢Δͱ͍͏ίʔυͰ͢ɻ ྫ֎ʹ͍ͭͯ͸ߨٛͰ·ͨઆ໌͢Δػձ͕ग़ͯ͘Δͱࢥ͍·͢ɻ
  17. 8JLJQFEJBͷΞΫηε਺ղੳ FODPEJOHVUG SFRVJSFDHJ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' MJTU<> XIJMFUFYUpMFHFUT CFHJO

    OFYUVOMFTTUFYUd?KB EBUBUFYUTQMJU I\UJUMF$(*VOFTDBQF EBUB<> DPVOUEBUB<>^ MJTUQVTII SFTDVF&YDFQUJPOF QF FOE FOE pMFDMPTF DPVOUॱʹιʔτ SFTVMUMJTUTPSU@CZEPcJc J<DPVOU>UP@J FOE τοϓදࣔ SFTVMUSFWFSTFpSTU  FBDIEPcJc QVUTJ FOE ͜͜·ͰͰ͖·ͨ͠ɻ
  18. ϑΝΠϧ͔Β֤ߦಡΈࠐΈ pMFOBNFKBUYU pMF'JMFPQFO pMFOBNF S65' XIJMFUFYUpMFHFUT QVUTUFYU FOE pMFDMPTF XIJMF৚݅੒ཱத͸܁Γฦ͠

    ͜ͷ৔߹ɺ৚݅͸ UFYUpMFHFUT ʹͳΓ·͢ɻ pMFHFUT ͸ߦಡΈࠐΉϝιου ಡΈࠐΊͨΒਅɺ ϑΝΠϧऴ୺ͰಡΈࠐΊͳ͍ ͱِ OJM ʹͳΓ·͢ɻ UFYUʹߦ໨ͷσʔλ͕ೖͬͯFOE·Ͱॲཧ XIJMFͷߦ΁໭Γɺ UFYUʹߦ໨ͷσʔλ͕ೖͬͯFOE·Ͱॲཧ શߦ܁Γฦ͠ ऴ୺ͰpMFHFUT͢Δͱ৚݅ෆ੒ཱʹͳΓ܁Γฦ͠ऴྃ
  19. OFYUจ XIJMFUFYUpMFHFUT  "  OFYU  #  FOE

    ܁Γฦ͠தʹOFYUจΛॻ͘ͱɺͦΕҎ߱ͷॲཧΛߦΘͣɺ ܁Γฦ͠ઌ಄ʹ໭͠·͢ɻ  " ͷ෦෼ͷॲཧ͕ߦΘΕͯOFYU΁͘Δͱɺ  # ͷ෦෼ͷॲཧ͸ߦΘΕͣɺ ܁Γฦ͠ઌ಄΁໭Γ·͢ɻ ڭՊॻQͷਤ͕෼͔Γ΍͍͢Ͱ͢ɻ ڭՊॻQ