Skip to main content
https://secure.travis-ci.org/rmaceissoft/django-facebook-realtime.png?branch=master

A reusable app to interact with facebook real-time updates (https://developers.facebook.com/docs/reference/api/realtime/)

Features

  • add/remove a subscription to changes in data in facebook

  • list all subscriptions

  • receive facebook real-time updates

Requirements

python, django, requests

Installation

  1. pip install git+git://github.com/rmaceissoft/django-facebook-realtime.git

  2. Add "dj_facebook_realtime" to your INSTALLED_APPS setting

  3. Add FACEBOOK_APP_ID, FACEBOOK_API_SECRET and FACEBOOK_REALTIME_VERIFY_TOKEN settings

  4. Wire up the views by adding a line to your URLconf:

    url(r'facebook/subscriptions/', include('dj_facebook_realtime.urls')),
  5. Make sure that current Site has a right domain value due to it’s used to build callback url used to verify subscriptions

Example of use

Adding a subscription

adding a subscription for changes on user’s friends and feed connections

python manage.py realtime_subscriptions_add --object_type=user --fields=friends,feed

Removing subscriptions

removing all existent subscriptions only for users

python manage.py realtime_subscriptions_delete --object_type=user

Listing all subscriptions

python manage.py realtime_subscriptions_list

Retrieving updates with facebook data changes

Below a snippet of code to handling realtime_update signal provided by django-facebook-realtime to keep posted of facebook changes through facebook realtime service:

from django.dispatch import receiver
from dj_facebook_realtime.signals import realtime_update


@receiver(realtime_update)
def handler_new_facebook_change(sender, object_type, uid, changed_fields, time, **kwargs):
    """
    handle facebook changes detected through facebook's real-time update service
    """
    if object_type == 'user':
        # make some action for changes related to facebook users
    elif object_type == 'page':
        # make some action for changes related to facebook pages

Metadata

Release files for django-facebook-realtime 0.1.1-20130208

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-facebook-realtime 0.1.1-20130208
File Size Uploaded
django-facebook-realtime-0.1.1-20130208.zip 13.4 kB Details

Release files / django-facebook-realtime-0.1.1-20130208.zip

Download URL django-facebook-realtime-0.1.1-20130208.zip
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aeadfe62277a0aca95adc140da4e67d155b6bda27396cb73caefc82c5fb6cb9b
BLAKE2b-256 checksum
How to use checksums
a36b7dcacb13fb872658d592e66a722e66fefc54147495e03526541633a9f72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1-20130208 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page