husonet | Tarih: 30.05.2011
python facebook uygulaması geliştirme GraphAPI örneği
Selamun Aleykum,
Facebook GraphApi örneği
Artık facebook kullanmayan yoktur ve hesaplarımızı canlandırmak isteyebiliriz işte tam bu işlere göre bir örnek.
Facebook GraphApi örneği
Artık facebook kullanmayan yoktur ve hesaplarımızı canlandırmak isteyebiliriz işte tam bu işlere göre bir örnek.
#!/usr/bin/python
#-*- coding:utf-8 -*-
##############################################################################
#·
# Hüseyin ÖZDEMİR
# 30.05.2011
# Husonet
# Facebook Uygulaması Örneği Amaç duvar a yazmak
#
##############################################################################
TOKEN = '********************'
def facebook_link(content, token, link, title):
        import urllib
        import urllib2
        import re
        content = re.sub(r'\s+', ' ', re.sub(r'<.*?>', '', content[:400]))
        url = "https://graph.facebook.com/me/feed"
        values = {'access_token': token,
                  'link': 'http://pythontr.com/' + link,
                  'name': title,
                  'caption': 'Bu bir pythontr.com örneğidir',
                  'description': content + '...'}
        data = urllib.urlencode(values)
        return urllib2.urlopen(url, data)
facebook_link('deneme icerik', TOKEN, 'makale.py=1', 'baslik')