Playframework2 + scalaで作成した、「Google Readerで自分が購読している記事」を解析し、出現する単語のトレンドを表示するアプリです。
Google Readerのデータを取得するために、Google oAuth2の「Web application API」を用いています。
また記事を形態素解析のために、javaで実装されディクショナリも内蔵されたKuromojiを利用しました。ありがとうございます!
Google API Consoleより、Google Serviceを利用するためのキーを取得してください。
- Google Readerは公式なサービスAPIが公開されていないため、「URL Shortener API」で代替します。「service」タブから「URL Shortener API」をONにしてください
- ProjectをCreateし、「Web application」のClientIDを生成してください(この際、RedirectURIは http://localhost:9000/oauth2callback にしてください)
- app/utils/Constants.scala の clintId, clientSecret, redirectURI を修正してください
必要なライブラリを追加し、ClassPathに定義してください
-
HTTPクライアント Apache HttpClient 4.1.3
- httpcore-4.1.4.jar
- httpclient-4.1.3.jar
-
HTML(XML)パーサ Validator.nu
- htmlparser-1.3.1-with-transitions.jar
-
形態素解析ライブラリ Kuromoji
- kuromoji-0.7.7.jar
Playframeworkのドキュメントに従い、Playframework 2.0.1をインストールしてください
- GoogleReaderPlay2ディレクトリで、
playを実行してください(Proxyの背後から利用する場合、play -Dhttp.proxyHost=192.168.0.1 -Dhttp.proxyPort=8080 -Dhttp.proxyUser=hoge -Dhttp.proxyPassword=fuga等、Proxyの設定を引数で指定してください) - Playコンソール上から、
clean - Playコンソール上から、
compile - Playコンソール上から、
run - ブラウザから
http://localhost:9000にアクセスすると、TOP画面が表示されます - 「Googleへログイン」からgoogle認証サイトへ遷移し、Googleアカウントでログインした後アプリケーションのアクセスを許可してください
- Google Readerに定義してあるフォルダのリストが表示されます
- 各フォルダの「単語クラウド表示」をクリックすると、そのフォルダに分類されたRSSフィードを80件取得し、出現頻度に従ってタグクラウド風に単語(名詞)を表示します
Copyright(C) 2012 Nobuyuki Matsui (nobuyuki.matsui@gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.