I would schedule a task to post on facebook's wall using spring social.
How can I do this?
I would schedule a task to post on facebook's wall using spring social.
How can I do this?
The Spring social sample on Github has some samples which will do the posting.
Here is the specific part of the code you need to use. I would assume that you might need to dig in a little before you can use this code.
public void postConnect(Connection<Facebook> connection, WebRequest request) {
if (request.getAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
try {
connection.updateStatus("I've connected with the Spring Social Showcase!");
} catch (ApiException e) {
// Do nothing: No need to break down if the post-connect post can't be made.
}
request.removeAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION);
}
}
Now, since you have the posting part, You need to write a scheduler to call this method. Read here on how to write a Quartz scheduler using spring. Read here for the Spring API of the same.
Actually now Facebook released this scheduling feature, so you don't need to be using some 3rd party application!
More on this :Facebook Brand Pages Update and Post Scheduling