2008/04/08

コードはcodereposに置いておきます。
/lang/python/webSimple
google appengineのurlfech APIがある場合は、そちらを使うようになっています。
ただしgoogle appengineにはminidomが使っているpyexpatが入ってないのでcontentを取得するまでは動きますがparse_xmlは動きません。
つまりはgoogle appengineのボツネタ第一号って事になりました。
なおfilckr_echo.plをpythonで書いた場合のコードは以下の様になります。
#!-*- coding:utf-8 -*-
from webSimple import Simple

api = Simple({
    'base_url' : 'http://api.flickr.com/services/rest',
    'param' : {
        'api_key' : 'your-api-key'
    },
})
res = api.get({
    'method' : 'flickr.test.echo',
    'name' : 'value',
});
print res.parse_xml().getElementsByTagName('name')[0].childNodes[0].data
google appengineでない場合には使えるのでよかったらどうぞ。
10分程度で作った物なので適当ですが
Posted at 19:24 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.