Cheng-Lung Sung (宋政隆) > WWW-Google-News-TW > WWW::Google::News::TW

Download:
WWW-Google-News-TW-0.12.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  

NAME ^

WWW::Google::News::TW - Access to Google's Taiwan News Service (Not Usenet)

SYNOPSIS ^

  use WWW::Google::News::TW qw(get_news);
  my $results = get_news();
  
  my $results = get_news_for_topic('金牌');

DESCRIPTION ^

This module provides a couple of methods to scrape results from Google Taiwan News, returning a data structure similar to the following (which happens to be suitable to feeding into XML::RSS).

  {
          '社會' => [
                        {
                          'update_time' => '11小時前',
                          'source' => '聯合新聞網-',
                          'summary' => '不少民眾向公平會檢舉,質疑中華電信每月帳單收取五元「屋內配線月租費」的合理性。公平會昨天決議,要求中華電信要讓樓高四樓以下的用戶,免收五元月租費,並把訊息揭露在電信帳單 ',
                          'url' => 'http://udn.com/NEWS/LIFE/LIFS2/2233728.shtml',
                          'headline' => '中華電配線費四樓以下建物免收'
                        },
                      ],
          '娛樂' => [
                        {
                          'update_time' => '2小時前',
                          'source' => '瀟湘晨報-',
                          'summary' => '本報綜合消息台灣金馬影展執委會昨日公佈本年度活動海報,兩款三幅都以彩虹為視覺主題,象徵電影的光影與夢想,強調創作者電影夢的實現,也是觀眾體驗電影夢的過程 ',
                          'url' => 'http://220.168.28.52:828/xxcb.rednet.com.cn/Articles/04/09/10/544900.HTM',
                          'headline' => '2004金馬影展海報出爐'
                        },
   }

METHODS ^

get_news()

Scrapes http://news.google.com.tw/news?ned=ttw and returns a reference to a hash keyed on News Section, which points to an array of hashes keyed on URL and Headline.

get_news_for_topic( $topic )

Queries http://news.google.com.tw/news?ned=tw for results on a particular topic, and returns a pointer to an array of hashes containing result data.

SEE ALSO ^

WWW::Google::News, http://news.google.com.tw/

TODO ^

* I haven't think about it yet....

AUTHORS ^

Cheng-Lung Sung <clsung@tw.freebsd.org>

KUDOS ^

Greg McCarroll <greg@mccarroll.demon.co.uk>, Bowen Dwelle <bowen@dwelle.org> for the basis of this module

COPYRIGHT ^

Copyright 2004,2005,2006,2007 by Cheng-Lung Sung <clsung@tw.freebsd.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: