简体   繁体   中英

Facebook wall writing application

I was wondering if i could possible write an app, that could be a list of all my friends and just simply posting a message to their walls on the friends i select. Not a message, a wall post. So it appears that i went to their wall and wrote a message, they have no idea that an app is pushing the message to them.

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

Please and thank you.

Check the Python SDK for the Facebook Graph API:

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

In particular, you want the put_wall_post function.

A short python script making use of this module should fit your needs perfectly.

Check out the Facebook API. It will more than likely show that the wall post came from your application. As far as the language you implement in, I think you could use Python.

There are a couple of Facebook APIs that could tie in to. I'm at work and any website that makes mention of facebook is blocked so I can't provide links, but Google 'Facebook API'.

Yes, it is possible. The facebook api supports Python via python-sdk . You would be interested in stream.publish ( link )

Sure, you could do this. You'll need to have a look at the docs . You can use the Python SDK to work in Python, and the Graph API to make the posts. Have fun

Here is below code to achieve your requirement in facebook application: (Your application should be already contain publish to wall permission. That you can find at Start up 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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM