Skip to main content

OAuth of Fanfou

Project description

import fanfou
import json

# print fanfou.APIs_all and browse https://github.com/FanfouAPI/FanFouAPIDoc/wiki/Apicategory

consumer = {'key': 'your key', 'secret': 'your secret'}

client = fanfou.XAuth(consumer, 'username', 'password')  # or using OAuth
# client = fanfou.OAuth(consumer, access_token)  # print fanfou.usage to learn more

fanfou.bound(client)  # if you like such client.statuses.update(...) than client.request('/statuses/update', ...)

client.request('/statuses/update', 'POST', {'status': 'test 1'})
client.statuses.update({'status': 'test 2'})
client.request('/photos/upload', 'POST', *fanfou.pack_image('test.jpg', 'test photo 1'))
client.photos.upload(*fanfou.pack_image('test.jpg', 'test photo 2'))

json.loads(client.statuses.home_timeline().read())  # Python2
json.loads(client.statuses.home_timeline().read().decode('utf8'))  # Python3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

fanfou-0.1.0-py3-none-any.zip (6.3 kB view hashes)

Uploaded Source

fanfou-0.1.0-py2-none-any.zip (6.3 kB view hashes)

Uploaded Source

Built Distributions

fanfou-0.1.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

fanfou-0.1.0-py2-none-any.whl (6.4 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page