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"
source
share