SlideShare a Scribd company logo
YAPC::Asia 2014 前夜祭
スタッフの方へお願い
不適切な発言があったら
ピー音入れて下さい
あたし
ID:hondallica(ホンダリカ)※Lは2つです
職業:HeavyMetal Programmer
年齢:100,03x歳
血液型:X
出身:北海道
好きな言葉:親に嫌われたら一人前だ
URL: http://sukuna.net/
   https://github.com/hondallica
Hachioji.pmに出没します。
本日のセットリスト
・ヘヴィメタルとは
・サービス(hrhm.info)のご紹介
・データの集め方
・副産物
問
お客様の中にハードロック・ヘヴィメタルが
好きな方はいらっしゃいますか?
ヘヴィメタルとは
ヘヴィメタルとは
・社会にちょっとなじめない人たちが
・重低音をかき鳴らしながら
・ファンタジーの世界に迷い込んだり
・世の中間違ってると叫んでいる
・聴いている人があんまりいない
・かわいい音楽
DEATH!!
本題
Hard Rock & Heavy Metal
Web Service
http://hrhm.info
YouTubeの動画探すの楽な
俺得サービス
DEMO
構成
・VPS: Digital Ocean ( 安い・SSD速い)
・Web Server: Nginx (使ってみたかった
・App Server: Starman (これしか知らなかった
・WAF: Mojolicious::Lite (覚えやすかった
・WebAPI: node.js( 使ってみたかった
・SQLite: ファイルポン置きでリリースできる
構成
・自分の既存の知識で扱える構成にする
 ▶ インフラ構築の勉強も兼ねているので
  スモールスタート
・とにかく公開することを優先
・個人サービスだし困ったら後で見直せばいい
データの集め方
必要なもの
・PC
 →データ収集専用機があるとよい(常時稼働)
・DB
 →お好みで
・ちょっとしたプログラミング能力
 →HTTP投げてDBに突っ込む程度で大丈夫
・狂気
 →根こそぎデータ集めるぞという気持ち
ひたすらデータを集める
ひたすら
Scraping、WebAPI
主な情報源
・HR/HMニュースサイト
・Last.fm
・SoundCloud
・MusicBrainz
・Bandcamp
・Myspace
・Facebook
・Twitter
押さえておくべき
2サイト
Last.fm
・インターネットラジオ + SNS
・ユーザーが聴いている曲情報が共有される
Last.fm
・恐ろしくAPIが充実している
Last.fm
・CPANモジュールあります
 ・Net::LastFM
 ・WebService::LastFM
 ・etc...
MusicBrainz
・音楽のWikipedia
・メタデータが豊富
MusicBrainz
・特にMusic Brainz ID(MBID)が重要
アーティスト、アルバム、楽曲などにユニークなID
が振られている。
4bd02db1-3592-4d15-9aa5-23c9591e49ce
Last.fmやその他音楽系WebAPIでは、リクエスト
パラメータにMBIDを使える事が多い。
サービス間連携に超重要!
MusicBrainz
・CPANモジュールあります
 ・WebService::MusicBrainz
MusicBrainz
さらに
MusicBrainz
・このサービスのVMがダウンロードできます
http://musicbrainz.org/doc/MusicBrainz_Server/Setup
・コマンドでマスターサーバとDB同期できる
・ローカル環境でAPI叩き放題
・DB(PostgreSQL)に直接アクセスも可
・チラ見した限りだと80万以上のアーティスト が登
録されていた
集めたデータ
Band
・Band Name
・Country
・Genre(Thrash, Death, Power...)
・Status(活動中,休止中,解散...)
・収集中ですがライヴ履歴も
100K〜 records
Artist
・Name
・Country
・Age
・Gender
・Part(ヴォーカル,ギター,ドラム...)
・History(今まで所属していたバンド)
500K〜 records
Discography
・Name
・Type(シングル,アルバム,ビデオ...)
・Release Date
240K〜 records
Track
・Title
・Length
・Lyric(ごく一部)
1.7M〜 records
Similar Band
・Band
・Similar Band
・Score(関連性を独自集計)
 ▶ 複数のWebAPIのスコア
 ▶ 同じアーティストが所属していた
 ▶ 一緒にライヴをやった回数
 ▶ 独断と偏見
4.2M〜 records
同名バンド
読めないバンド
↑文字化けではありませんバンド名です
頻出ワード
Death Black Dead Blood War
Life Night Time World Hell
Dark Die Darkness Fire End
Last Love Evil God Metal
みなさんもよく使うと思います
似ている・関連バンド(demo)
http://hrhm.info/similar
DB
・最初はとにかく集める
・サイトによって取れる情報が異なる
 ▶ いきなりきれいに構造化はできない
・HTML、JSON、XMLを生データのままDBに
 格納しておく
・最低限サービス公開に使う情報を構造化
 例:バンド名、アルバム名、曲名、国、
   ジャンル、アーティスト名
データ収集中に生まれた
副産物
メタル系の人は
ヘビメタって言われるのを
嫌います
曲に合わせて頭振るのを
ヘッドバンギングと
言いますが
ヘッドバンキングって
書いてるのをよく見ます。
何銀行だよ!?
副産物(1)
Chrome拡張作りました。
https://github.com/hondallica/userscript-heavymetal
副産物(1)
最高にクールだろ?
副産物(2)
さきほどご紹介したLast.fmのCPANモジュール
Net::LastFM
api_keyいちいち入力したくないので、引数を省略
したら$ENVから読みたい。
副産物(2)
依存モジュールが重そうだった。
副産物(2)
完成してませんが、Net::LastFM::Liteを作ってみ
ました。(GET系APIなら動くはず)
https://github.com/hondallica/p5-Net-LastFM-Lite
副産物(2)
ほぼモジュール差し替えですが
副産物(2)
けっこう速くなった。
Benchmark: timing 400 iterations of lfm, lfml...
lfm: 305 wallclock secs ( 1.34 usr + 0.17 sys = 1.51 CPU) @ 264.90/s (n=400)
lfml: 296 wallclock secs ( 0.66 usr + 0.13 sys = 0.79 CPU) @ 506.33/s
(n=400)
Rate lfm lfml
lfm 265/s -- -48%
lfml 506/s 91% --
副産物(3)
・bandcampというアーティスト直販サービス
・インディーズバンド多め
副産物(3)
・APIはありますがCPANモジュールなかった
副産物(3)
WebService::Bandcampリリースしました。
残念なことに
APIキーの配布が停止中
このモジュールは
APIドキュメントからリンクされてる
サンプルリクエストのキーを使って作った。
自分専用として始めた
サービスですが
現在95カ国からご利用頂いております
アフリカ・中東・グリーンランド、北朝鮮に
メタラーのお友達がいたら宣伝をお願いします
まとめ
・自分の好きな事を形に
・データ持ってるとできることが広がる
・しょぼくても公開する事が大事
 ▶ この場で話す機会がいただけた!
The End

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

YAPC::Asia 2014 前夜祭