Code Archive Skip to content Google About Google Privacy Terms
Usage examples >>> from placemaker import placemaker >>> p = placemaker(YOUR_API_KEY) >>> p.find_places("I live in Virginia Beach. I grew up in Baltimore") [<Placemaker Place: 'Baltimore, MD, US'>, <Placemaker Place: 'Virginia Beach, VA, US'>] >>> p.places [<Placemaker Place: 'Baltimore, MD, US'>, <Placemaker Place: 'Virginia Beach, VA, US'>] >>> p.geographic_scope <Placemaker GeographicScope: 'Ea
gdataライブラリをダウンロードしてきます。 http://code.google.com/p/gdata-python-client/ インストールしなくても以下のディレクトリが見えていれば実行できます。 gdata/ atom/ カレンダーに予定を書き込んで、予定の一覧を表示するコードです。 import gdata.calendar.service import gdata.service import atom.service import gdata.calendar import getopt, sys, string, time, atom calendar_service = gdata.calendar.service.CalendarService() calendar_service.email = '********' calendar_service.passw
ばずったーみたいなものを作りたくて、Mecabでほげほげしてたのですが、Yahoo!からなんか便利そうなAPIが出たので使ってみました。 Yahoo!デベロッパーネットワーク - テキスト解析 - キーフレーズ抽出 このAPIはJSONで返してくれるので、超簡単に使えました! 以下Python2.6でのサンプルです。 # -*- coding:utf8 -*- import urllib import urllib2 import json text = u"東京ミッドタウンから国立新美術館まで歩いて5分で着きます。" url = "http://jlp.yahooapis.jp/KeyphraseService/V1/extract" params = { "appid":"ApplicationID", "sentence":text, "output":"json", } json_
最近、TwitterがTinyURLを捨ててbit.lyを採用したらしい。そんなこともあって、URL短縮サービスに興味がわいたので、以前にGoogle App Engineで作成したTwitter送信機能付きメッセージボードで書き込んだURLをbit.lyで短縮して送信できるようにしてみた。今まではURLを含む投稿はTwitterに送信しないようにしていた。以下にbit.lyのAPIをPythonを使ってどのように利用すればよいか書いてみる。 まずは、bit.lyで無料アカウントを取得する。これでAPI Keyが貰えるので、bit.lyのAPIを利用できるようになる。次に、bit.ly APIの解説を参考にしながら、APIを使ってみる。URLの短縮も展開も簡単だ。JSONでもXMLでも利用できるが、今回はsimplejsonを使ってJSONを利用している。 詳しくは最後にソースコードを付け
動機 Macにはmixiフォトアップローダが無かったり、mixi stationの調子が悪かったりして頭に来たので、スクリプトで同様のアプリケーションを作ってみようと思った。 できた物 WSSE.py (ファイル後半) 使い方 一通りの使い方はこんな感じ。 mc = MixiClient('username','password') tracks = mc.getTracks() # 足あとの取得(10件) notify = mc.getNotify() # お知らせの取得 friends = mc.getFriends() # マイミク一覧の取得 update = mc.getUpdates() # 更新情報一覧の取得 albumurl = mc.createAlbum(u'旅行', u'旅行の写真') # 新規フォトアルバムの作成 mc.postPicsToAlbum(['photo1
Python | 先輩から Java から Google 翻訳を行うライブラリ google-api-translate-java を使って良かったよというのを聞いたので、Python 版の pytranslator を使ってみました。 #!/usr/bin/env python # coding: utf-8 from Translator import Translator # 日本語から英語へ j2e = Translator('ja', 'en') print j2e.translate('こんにちは') # 英語から日本語へ e2j = Translator('en', 'ja') print e2j.translate('Hello').encode('utf-8') これを sample_Translator.py という名前で保存して次のように実行します。 kyoshida
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く