Skip to main content

Django implementation for odnoklassniki API Discussions

Project description

Django Odnoklassniki Discussions
================================

[![PyPI version](https://badge.fury.io/py/django-odnoklassniki-discussions.png)](http://badge.fury.io/py/django-odnoklassniki-discussions) [![Build Status](https://travis-ci.org/ramusus/django-odnoklassniki-discussions.png?branch=master)](https://travis-ci.org/ramusus/django-odnoklassniki-discussions) [![Coverage Status](https://coveralls.io/repos/ramusus/django-odnoklassniki-discussions/badge.png?branch=master)](https://coveralls.io/r/ramusus/django-odnoklassniki-discussions)

Приложение позволяет взаимодействовать с дискуссиями соц. сети Одноклассники, их статистикой и пользователями групп через OK API используя стандартные модели Django

Установка
---------

pip install django-odnoklassniki-discussions

В `settings.py` необходимо добавить:

INSTALLED_APPS = (
...
'oauth_tokens',
'taggit',
'odnoklassniki_api',
'odnoklassniki_groups',
'odnoklassniki_users',
'odnoklassniki_discussions',
)

# oauth-tokens settings
OAUTH_TOKENS_HISTORY = True # to keep in DB expired access tokens
OAUTH_TOKENS_ODNOKLASSNIKI_CLIENT_PUBLIC = '' # application public key
OAUTH_TOKENS_ODNOKLASSNIKI_CLIENT_SECRET = '' # application secret key
OAUTH_TOKENS_ODNOKLASSNIKI_SCOPE = [''] # application scopes
OAUTH_TOKENS_ODNOKLASSNIKI_USERNAME = '' # user login
OAUTH_TOKENS_ODNOKLASSNIKI_PASSWORD = '' # user password

Покрытие методов API
--------------------

* [group.getInfo](http://apiok.ru/wiki/display/api/group.getInfo) – получение информации о группах;
* [group.getInfo](http://apiok.ru/wiki/display/api/group.getMembers) – получение списка пользователей группы;

Примеры использования
---------------------

### Получение группы

>>> from odnoklassniki_discussions.models import Group
>>> Group.remote.fetch(ids=[47241470410797])
[<Group: Кока-Кола>]

### Получение подписчиков группы

Для этого необходимо установить дополнительно приложения:
[`django-odnoklassniki-users`](http://github.com/ramusus/django-odnoklassniki-users/) и добавить его в `INSTALLED_APPS`
[`django-m2m-history`](http://github.com/ramusus/django-m2m-history/)

>>> from odnoklassniki_discussions.models import Group
>>> group = Group.remote.fetch(ids=[47241470410797])[0]
>>> group.update_users()
>>> group.users.count()
987

Project details


Download files

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

Source Distribution

django-odnoklassniki-discussions-0.0.6.tar.gz (29.9 kB view details)

Uploaded Source

File details

Details for the file django-odnoklassniki-discussions-0.0.6.tar.gz.

File metadata

File hashes

Hashes for django-odnoklassniki-discussions-0.0.6.tar.gz
Algorithm Hash digest
SHA256 c38ba546e5ea3750842121429309c4695ec52466c62011502a38a93236df0829
MD5 f7d50f752fc330506d40d7949e72ec5a
BLAKE2b-256 9bad7698c35a54552d6941256c98d852782a500d69863d5689b1192156b6222e

See more details on using hashes here.

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