Facebook Wall Writing Application

I was wondering if I could write an application, it could be a list of all my friends and just send a message to my friends who I choose. Not a message, a wall message. Thus, it seems that I went up to their wall and wrote a message, they do not suspect that the application is clicking on the message.

can also be written in python :) its what i know. php is so icky, but doable if that is the only option.

Please thanks.

+3
source share
6 answers

Check out the Python SDK for the Facebook API:

http://github.com/facebook/python-sdk

In particular, you need a function put_wall_post.

python script, , .

+5

API Facebook. , , , . , , , Python.

+4

API- Facebook, . , , facebook, , , Google API Facebook.

+3

, . facebook api Python python-sdk. stream.publish ()

+3

Of course you could do it. You need to take a look at the docs . You can use the Python SDK to work in Python, and the Graph API to post messages. Enjoy

+3
source

Below is the code to achieve your requirement in the facebook application: (Your application must already be published for permission on the wall, which you can find in Run the application )

update_url = "https://graph.facebook.com/<Your_Friend_Facebook_ID>/feed"
form_fields = {
   "access_token": "Your Access Token",
   "message" : "Your Message"
}
temp = {}
for k, v in form_fields.iteritems():
  temp[k] = unicode(v).encode('utf-8')

form_data = urllib.urlencode(temp)
res = urlfetch.fetch(url=update_url,
                     payload=form_data,
                     method=urlfetch.POST,
                     headers={'Content-Type': 'application/x-www-form-urlencoded'})
result = json.loads(res.content)
if result.get('id', False):
   "Success"
else:
   "Failure"
+2
source

Source: https://habr.com/ru/post/1756383/


All Articles