I want to update my Facebook status through my Java console application. I am using the Jsoup HTML parser.
First I need to login to the Facebook account.
Document doc = Jsoup.connect("http://www.facebook.com")
.data("email", "myemailid")
.data("pass", "mypassword")
// And other fields which are being passed in post request.
.userAgent("Mozilla")
.post();
When I print doc on the console, I can see that I am able to log in, but that login is through Facebook Mobile. Why not the PC version?
Is it possible to use this doc variable to update my Facebook status?
How can I achieve this?
Although this may work in the end, it is not a proper way to communicate with Facebook.
Facebook has an official API which should be used to post updates. restfb is a nice java client for that API.