|
Revision 9135, 349 bytes
(checked in by mattn, 5 years ago)
|
|
lang/python/webSimple,
lang/python/webSimple/example,
lang/python/webSimple/example/flickr_echo.py,
lang/python/webSimple/webSimple.py:
added python version of 'WebService::Simple'.
|
| Line | |
|---|
| 1 | #!-*- coding:utf-8 -*-
|
|---|
| 2 | from webSimple import Simple
|
|---|
| 3 |
|
|---|
| 4 | api = Simple({
|
|---|
| 5 | 'base_url' : 'http://api.flickr.com/services/rest',
|
|---|
| 6 | 'param' : {
|
|---|
| 7 | 'api_key' : 'your-api-key'
|
|---|
| 8 | },
|
|---|
| 9 | })
|
|---|
| 10 | res = api.get({
|
|---|
| 11 | 'method' : 'flickr.test.echo',
|
|---|
| 12 | 'name' : 'value',
|
|---|
| 13 | });
|
|---|
| 14 | print res.parse_xml().getElementsByTagName('name')[0].childNodes[0].data
|
|---|