tags:

views:

112

answers:

3

i want to develop a python desktop app which interacts and posts its content on facebook , twitter or gtalk as a message . is it possible?... tutorials and ideas will help

+2  A: 

You can check out APIs of Facebook, Twitter and Gtalk

Xinus
i did , but they are for developing apps for integrating facebook app inside facebook environment . i dont want that
mekasperasky
Then make a thin application in facebook that provides Interface to your python dektop app.
Kugel
You can include it in your application .. http://wiki.developers.facebook.com/index.php/API
Xinus
+5  A: 

The Twitter API will help you for Twitter, since it's intended to help you post messages. The Facebook API isn't actually what you want - it helps you write applications which run on Facebook, but doesn't necessarily help you communicate with Facebook the way that a user would. To do that you might need to look at how Facebook communicates with a browser - using something like Firebug and Live HTTP Headers and then replicating the browser behaviour using urllib/urllib2 (there is an excellent tutorial here). For gtalk, the underlying implementation is Jabber/XMPP for which you should be able to find plenty of documentation (there's even a book published by O'Reilly).

Nick Bastin
can i implement it all in the same code and run all the process at the same time?
mekasperasky
Of course you can !
Pierre Bourdon
+3  A: 

If you can't find a facebook API to suit your needs, you'll have to make one from scratch. Try using the Charles web debugging proxy to surf around facebook and post comments, add friends etc. It will reveal and log all the headers and GET/POST traffic. You can use the logged requests and responses to engineer your own API. It'll be a pain, but its a good exercise. If you get stuck, just post a query on this website. The issues are all common enough that people post solutions within a few minutes.

A few pointers:

  • Facebook requires a login, meaning you'll probably need to build your own urlopener using a cookie handler from cookielib. You'll also have to get comfortable programming HTTP POST requests.
  • Facebook probably won't tolerate traffic from automated scripts, so all your traffic with the website will have to emulate a browser--slowish request rates, and a strategically defined "user-agent" element in the HTTP request headers.
twneale
+1 for pointing out a very cool tool.
Nick Bastin