ほんとにPHP使い始めたら止めようと初めたときから思ってたのでここでの更新やめます。 (あとはてなダイアリーがEUC-JPとかだったりするので) 移転先はとくにありません。 散文的なものは主に以下を更新してるようです。 - https://gist.github.com/sasezaki - jottit
こんな場末の日記をご覧の方は、ZF2のプラグイン機構では、クラス定義の読み込みをPluginClassLoaderが、インスタンス化をPluginBrokerが行うということはご存知ですよね!え、ご存知ない?Wikipedia創設者ZFリードデペロッパーMatthew Weier O'Phinneyからのメッセージをお読みください。 Introducing Zend Framework 2.0View more presentations from Matthew Weier O’Phinney. Introducing the ZF2 Plugin Broker http://weierophinney.net/matthew/archives/248-Introducing-the-ZF2-Plugin-Broker.html で、LazyLoadingをする場合は、PlginBrok
たった*行のコードでHTML取得&解析をしたい場合はWeb::Scraperが便利をexthtmlを使った場合、こんな感じになります。 $ exthtml -x '//div[@id="topicsfb"]//li//text()' -a='Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)' http://www.yahoo.co.jp/詳しくは、exthtmlの解説ページで。 cpan分からないという方には、phpのインスパイア版(exthtml.php)があります。 extphp -x '#topicsfb li' -v text http://www.yahoo.co.jp -a 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)
もちろん英語だけどな。。 PHP/Curlの本は2年前に出てるんだけれど*1、 Zend PHPカンファレンスでもスクレイピングの講演を行った elazar*2のミニ本がPHP|Architectで今年の3/4あたりで出るらしい。 んで、その内容はgithubに挙げられてる! http://github.com/elazar/web-scraping-with-php/tree/master 要チェックや!(こんな瑣末ウェブロ読んでる酔狂な人が) *1:http://www.amazon.com/Webbots-Spiders-Screen-Scrapers-Developing/dp/1593271204/ *2:http://ishouldbecoding.com/
今回は、架空のサイトevents.php.bunko.jpを対象にスクレイプ&spidering対象にします。 仮に、勉強会の参加回数を聞かれて答えに窮する状況があったとします。 参加回数の表示機能は、カリオストロ城の奥地に眠っているらしくすぐに使うのは困難なようです。 特定のメンバー名だけならすぐにカウントできそうですが、メンバー一覧を取得しDBに格納したいものです。 取得する主な対象は、メンバー一覧ですが、発表タイトルでどのように参加状況が変わるかも調べてみたいとします。 <?php //発表タイトル $titles = new Diggin_Scraper_Process(); $titles->process('//h4', 'title[] => TEXT'); //参加者 $members = new Diggin_Scraper_Process(); $members->pr
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く