The jonki

呼ばれて飛び出てじょじょじょじょーんき

東京の天気予報を発言する春ちゃんボットつくった。
















最近流行の春ちゃんのお天気情報を発言します。
http://twitter.com/wf_tokyo

お天気情報はlivedoor (http://weather.livedoor.com/forecast/rss/13/63.xml) さんから。
6時半に出力ってのはcron使ってます。
■ソース


#!/usr/bin/python
#-*- coding: utf-8 -*-

#@author Junki OHMURA
#@date 2009/02/12

import urllib2
from BeautifulSoup import BeautifulSoup
import twitter

url = "http://weather.livedoor.com/forecast/rss/13/63.xml"
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html)

item = soup.findAll("item")
title = soup.findAll("title")

#print item[1].title.string
string = item[1].description.string

tapi = twitter.Api(username='ユーザ名', password='パスワード')
status = tapi.PostUpdate(string)