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.5.tar.gz (17.8 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-odnoklassniki-discussions-0.0.5.tar.gz
Algorithm Hash digest
SHA256 34a30139da40a745f55cdd2ed9d0eeda235cdc3b321fedc194e62db11029254b
MD5 5dbf48062e3c675b8859283b9981cfd5
BLAKE2b-256 3dc9b2594568a8724d207606490cf7ee0d86251710d804dc0abae089d4cff0c5

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