Python BlogPing
YahooとGoogleへブログピングを送るサンプルです.他のサーバーへも簡単に拡張できます.サンプルプログラム
#coding: utf-8
import urllib
def blogping(rss):
pingservers = [\
['http://blogsearch.google.co.jp/ping?','url'],\
['http://api.my.yahoo.co.jp/rss/ping?','u'],\
]
response = []
for server in pingservers:
data = {}
data[server[1]] = rss
response.append(urllib.urlopen(server[0]+urllib.urlencode(data)).read())
return response
サンプルプログラムの使用例
#!/usr/local/bin/python
#coding: utf-8
from blogping import blogping
response = blogping('http://howbona.sblo.jp/index.rdf')
for res in response:
print res
ダウンロード
サンプルプログラムサンプルプログラムの使用例