mediapop / django-friendface

Getting Facebook to work for Django.
2 stars 0 forks source link

Implement the OpenGraph. #31

Open kitsunde opened 11 years ago

kitsunde commented 11 years ago

It should be possible to define OpenGraph actions and objects and then get their URL via get_absolute_url and also make the templates overriable. So say you would have an object at http://www.mediapop.co/facebook/123456789/enter-giveaway that has:

<html>
    <head>
        <title>{{ obj.title }}</title>
        <meta propery="og:description" content="{{ obj.description }}">
        <meta propery="title" content="{{ obj.title }}">
    </head>
    <body>
        <script>top.location.href = "{{ obj.next }}"</script>
    </body>
</html>

Then we could publish doing something like:

action = request.facebook.action.set.get(name='enter')
obj = GraphObject.models.create(
    action=action,
    user=facebook_user,
    title='Entered giveaway!', 
    description='Pancakes!',
    next='http://www.google.com')