SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
真・ドルヲタを支える技術
    @nipotan
アツい夏、TIF の夏

• TOKYO IDOL FESTIVAL
• http://www.idolfes.com/
 •   TOKYO IDOL FESTIVAL(トウキョウ・アイドル・フェスティバ
     ル)は、2010年より開催されている日本のアイドルイベントであ
     る。略称はTIF(ティフ)。女性アイドルグループを中心に50組以
     上の女性アイドルが参加する。参加アイドルの数では日本最大規
     模のアイドルイベントである。 (出典: Wikipedia)
TIF 2012

• 8/4, 8/5 の二日間
• 10 ステージ、111 組 732 名のアイドル
 (土曜は 9 ステージ)

• 2012 年の目玉は SKE48
お気に入り

• お気に入りのアイドルを見たい!
• タイムテーブルを見よう
 • http://www.idolfes.com/2012/timetable/
WTF


• 画像かよ!!
否


• iPhone, Androidで見ると
 • http://www.idolfes.com/2012/sp/
タイムテーブル


• もっと検索しやすく
 • やっぱ iCal
iCal 系 CPAN モジュール



• http://search.cpan.org/search?
  query=ical&mode=all
iCal 形式

• テキストベースだから何となくわかるね
• 適当なイベントを作って、iCal で export
 してみよう
形式
• iCal の形式
   BEGIN:VCALENDAR
   METHOD:PUBLISH
   VERSION:2.0
   X-WR-TIMEZONE:Asia/Tokyo
   X-WR-CALNAME:カレンダー名
   X-WR-CALDESC:説明
     (イベントデータ)
   END:VCALENDAR
形式
• イベント
         BEGIN:VEVENT
            :
            :
         END:VEVENT
形式
• イベントの見てもよくわからんデータ
    UID:ランダム文字列
    SEQUENCE:0
    STATUS:CONFIRMED
    TRANSP:OPAQUE
形式
 • イベントの見りゃわかるデータ
DTSTART:開始日時 (%Y%m%dT%H%M%SZ)
DTEND:終了日時 (%Y%m%dT%H%M%SZ)
SUMMARY:イベントのタイトル
LOCATION:場所
DESCRIPTION:説明
Let’s Scrape
use strict;
use warnings;
use Web::Scraper;

my $tif = scraper {
    process 'section', 'event[]' => scraper {
        process 'time', 'time' => 'TEXT';
        process 'div > h4', 'title' => 'TEXT';
        process 'div > p', 'performer' => [
            'HTML', sub { s{<brs*/>s*}{n}g },
        ];
    };
};
URL
• $date は 0804 か 0805
• $stage は hot とか green とか doll とか
my $url = "http://www.idolfes.com/2012/sp/time${date}_${stage}.html";
ステージ名
• ちゃんと正式名称がある
 • 場所に使える
my %stages = (
    hot        =>   'HOT STAGE',
    green      =>   'GREEN OASYS',
    doll       =>   'DOLL FACTORY',
    fantastic =>    'FANTASTIC THEATER',
    wonder     =>   'WONDER FUTURE PLANET',
    smile      =>   'SMILE GARDEN',
    sky        =>   'SKY STAGE',
    secret     =>   'SECRET COURT',
    fresh      =>   'FRESH FIELD',
    welcome    =>   'WELCOME MARQUEE',
    greeting =>     'GREETING SQUARE',
);
greeting
• 自由すぎる
 • http://www.idolfes.com/2012/sp/
    time0804_greeting.html
ステージ名
• greeting はパス…
my %stages = (
    hot        => 'HOT STAGE',
    green      => 'GREEN OASYS',
    doll       => 'DOLL FACTORY',
    fantastic => 'FANTASTIC THEATER',
    wonder     => 'WONDER FUTURE PLANET',
    smile      => 'SMILE GARDEN',
    sky        => 'SKY STAGE',
    secret     => 'SECRET COURT',
    fresh      => 'FRESH FIELD',
    welcome    => 'WELCOME MARQUEE',
#    greeting => 'GREETING SQUARE',
);
開始時刻と終了時刻
• そもそも iCal の日時は UTC
 • DateTime でちゃんと取り扱おう
開始時刻と終了時刻
• 時刻の形式
 • HH:MM∼HH:MM
my($from_time, $to_time) = split /x{ff5e}/, $event->{time};
開始時刻と終了時刻
• 罠その 1
 • 8/4 の HOT STAGE
 • http://www.idolfes.com/2012/sp/
    time0804_hot.html
開始時刻と終了時刻
• 罠その 2
 • 8/4 の FANTASTIC THEATER ほか
 • http://www.idolfes.com/2012/sp/
      time0804_fantastic.html
% perl -MDateTime -e'DateTime->new(hour => 24)'
The 'hour' parameter ("24") to DateTime::new did not pass the 'an
integer between 0 and 23' callback
開始時刻と終了時刻
• 罠その 3
 • 8/4 WELCOME MARQUEE 9:45∼10:00
 • http://www.idolfes.com/2012/sp/
   time0804_welcome.html
   • 通常 vs ここだけ
開始時刻と終了時刻
• 時刻の形式
 • HH:MM∼HH:MM
my($from_time, $to_time)
    = split /[x{ff5e}x{301c}]/, $event->{time};
出演ユニット
• イベントタイトルと出演者が別の場合
 • performer に
iCal のデータ形式
• 75 文字で改行させないといけない
 • 続く次の行は空白かタブではじまる
•  は  に
• 改行は n に
• , は , に
iCal で安全な形式
sub ical_safe {
    my $str = shift;
    $str =~ s///g;
    $str =~ s/n/n/g;
    $str =~ s/,/,/g;
    my @rounded = ();
    while ($str =~ s/^(.{1,75})//) {
        push @rounded, $1;
    }
    return join("n ", @rounded);
}
最終的に


• https://gist.github.com/3282049
取り込んだ例


• DEMO
まとめ
• User-Agent を iPhone は意外に盲点
• Web::Scraper やっぱり便利
• 何事も CPAN に頼らない
• アイドル別のほうが高まれる
• http://www.amazon.co.jp/dp/B008OI71MK
糸冬了


• QUESTIONS?

Contenu connexe

Dernier

Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
UPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdfUPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdffurutsuka
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。iPride Co., Ltd.
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000Shota Ito
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxAtomu Hidaka
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directoryosamut
 

Dernier (9)

Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
Amazon SES を勉強してみる その12024/04/12の勉強会で発表されたものです。
 
UPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdfUPWARD_share_company_information_20240415.pdf
UPWARD_share_company_information_20240415.pdf
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
新人研修のまとめ       2024/04/12の勉強会で発表されたものです。新人研修のまとめ       2024/04/12の勉強会で発表されたものです。
新人研修のまとめ 2024/04/12の勉強会で発表されたものです。
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000PHP-Conference-Odawara-2024-04-000000000
PHP-Conference-Odawara-2024-04-000000000
 
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptxIoT in the era of generative AI, Thanks IoT ALGYAN.pptx
IoT in the era of generative AI, Thanks IoT ALGYAN.pptx
 
20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory20240412_HCCJP での Windows Server 2025 Active Directory
20240412_HCCJP での Windows Server 2025 Active Directory
 

En vedette

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 HubspotMarius 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 ChatGPTExpeed 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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil 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 2024Albert 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 InsightsKurio // 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 2024Search 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 summarySpeakerHub
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit 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 managementMindGenius
 
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
 

En vedette (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...
 

真・ドルヲタを支える技術