public class Facebook extends BasicSense
Modifier and Type | Field and Description |
---|---|
java.lang.String |
appOauthKey |
java.lang.String |
appOauthSecret |
static int |
MAX_LOOKUP |
static java.lang.String |
oauthKey |
static java.lang.String |
oauthSecret |
conversations, DAY, DEFAULT_SPEAKER, engaged, HOUR, MAX_FILE_SIZE, MINUTE, RETRY
Modifier and Type | Method and Description |
---|---|
java.lang.String |
authorizeAccount(java.lang.String callbackURL)
Authorise a new account to be accessible by Bot.
|
void |
authorizeComplete(java.lang.String pin)
Authorise a new account to be accessible by Bot.
|
void |
awake()
Start sensing.
|
void |
checkAutoPost()
Auto post.
|
void |
checkFriends()
Check friends.
|
void |
checkNewsFeed()
Check news feed posts.
|
void |
checkProfile()
Check profile for messages.
|
void |
checkRSS()
Check RSS feed.
|
void |
checkWall()
Check wall posts.
|
void |
connect() |
void |
connectAccount() |
java.lang.String |
createJSONAttachment(java.lang.String command,
java.lang.String id,
java.lang.String text)
Check the command JSON for a Facebook attachment object to append to a Facebook Messeneger message.
|
java.lang.String |
createJSONQuickReply(java.lang.String command,
java.lang.String id,
java.lang.String text)
Check the command JSON for a Facebook attachment object to append to a Facebook Messeneger message.
|
java.lang.String |
format(java.lang.String text)
Prepare and format the text for Facebook.
|
java.lang.String |
getAppOauthKey() |
java.lang.String |
getAppOauthSecret() |
boolean |
getAutoFriend() |
java.util.List<java.lang.String> |
getAutoFriendKeywords() |
boolean |
getAutoPost() |
int |
getAutoPostHours() |
java.util.List<Vertex> |
getAutoPosts(Network network) |
java.lang.String |
getButtonType() |
facebook4j.Facebook |
getConnection() |
boolean |
getFacebookMessenger() |
java.lang.String |
getFacebookMessengerAccessToken() |
java.util.List<java.lang.String> |
getFriends()
Return the list of friends names.
|
java.lang.String |
getGetStartedButton() |
java.lang.String |
getGreetingText() |
boolean |
getLikeAllPosts() |
java.util.List<java.lang.String> |
getLikeKeywords() |
int |
getLikes() |
int |
getMaxFeed() |
int |
getMaxFriends() |
int |
getMaxLike() |
int |
getMaxPost() |
int |
getMessagesProcessed() |
java.util.List<java.lang.String> |
getNewsFeedKeywords() |
java.lang.String |
getOauthKey() |
java.lang.String |
getOauthSecret() |
java.lang.String |
getPage() |
java.lang.String |
getPageId() |
java.util.List<java.lang.String> |
getPages() |
java.lang.String |
getPersistentMenu() |
java.util.List<java.lang.String> |
getPostKeywords() |
java.util.List<java.lang.String> |
getPostRSS() |
int |
getPosts() |
int |
getPostsProcessed() |
boolean |
getProcessAllNewsFeed() |
boolean |
getProcessAllPosts() |
boolean |
getProcessNewsFeed() |
boolean |
getProcessPost() |
java.lang.String |
getProfileName() |
boolean |
getReplyToMessages() |
java.util.List<java.lang.String> |
getRssKeywords() |
boolean |
getStripButtonText() |
java.util.List<java.lang.String> |
getTimeline()
Return the time-line.
|
java.lang.String |
getToken() |
java.util.Date |
getTokenExpiry() |
boolean |
getTrackMessageObjects() |
java.lang.String |
getUserName() |
java.lang.String |
getWelcomeMessage() |
void |
initProperties()
Load settings.
|
void |
input(facebook4j.Comment comment,
facebook4j.Comment parent,
Network network)
Process the post comment.
|
void |
input(java.lang.Object input,
Network network)
Process the post.
|
void |
inputSentence(java.lang.String text,
java.lang.String userName,
java.lang.String targetUserName,
java.lang.String messageId,
long time,
Network network)
Process the text sentence.
|
boolean |
isPage() |
void |
like(facebook4j.Post post)
Like the post.
|
void |
log(facebook4j.FacebookException exception) |
void |
migrateProperties()
Migrate to new properties system.
|
void |
output(Vertex output)
Output the post or direct message reply.
|
void |
outputPost(java.lang.String post)
Output the post if facebook is connected.
|
void |
post(java.lang.String text,
java.lang.String reply)
Post.
|
void |
post(Vertex source,
Vertex sentence) |
void |
postComment(Vertex source,
Vertex sentence,
Vertex postId) |
long[] |
processComment(facebook4j.Comment comment,
facebook4j.Comment parent,
Network memory,
int count,
long max,
long last) |
void |
saveProperties(java.util.List<java.lang.String> autoPosts) |
void |
sendFacebookMessengerButtonMessage(java.lang.String text,
java.lang.String command,
java.lang.String replyUser,
java.lang.String id)
Send a button template message to the user.
|
void |
sendFacebookMessengerMessage(java.lang.String text,
java.lang.String replyUser,
java.lang.String id)
Send a message to the user.
|
void |
sendMessage(java.lang.String text,
java.lang.String replyUser,
java.lang.String id)
Send a message to the user.
|
void |
sendMessage(Vertex source,
Vertex message,
Vertex conversationId)
Send a message to the user.
|
void |
setAppOauthKey(java.lang.String appOauthKey) |
void |
setAppOauthSecret(java.lang.String appOauthSecret) |
void |
setAutoFriend(boolean autoFriend) |
void |
setAutoFriendKeywords(java.util.List<java.lang.String> autoFriendKeywords) |
void |
setAutoPost(boolean autoPost) |
void |
setAutoPostHours(int autoPostHours) |
void |
setButtonType(java.lang.String buttonType) |
void |
setConnection(facebook4j.Facebook connection) |
void |
setFacebookMessenger(boolean facebookMessenger) |
void |
setFacebookMessengerAccessToken(java.lang.String facebookMessengerAccessToken) |
void |
setGetStartedButton(java.lang.String getStartedButton) |
void |
setGreetingText(java.lang.String greetingText) |
void |
setLikeAllPosts(boolean likesAllPosts) |
void |
setLikeKeywords(java.util.List<java.lang.String> likeKeywords) |
void |
setLikes(int likes) |
void |
setMaxFeed(int maxFeed) |
void |
setMaxFriends(int maxFriends) |
void |
setMaxLike(int maxLike) |
void |
setMaxPost(int maxPost) |
void |
setMessagesProcessed(int messagesProcessed) |
void |
setNewsFeedKeywords(java.util.List<java.lang.String> newsFeedKeywords) |
void |
setOauthKey(java.lang.String oauthKey) |
void |
setOauthSecret(java.lang.String oauthSecret) |
void |
setPage(java.lang.String page) |
void |
setPageId(java.lang.String pageId) |
void |
setPages(java.util.List<java.lang.String> pages) |
void |
setPersistentMenu(java.lang.String persistentMenu) |
void |
setPostKeywords(java.util.List<java.lang.String> statusKeywords) |
void |
setPostRSS(java.util.List<java.lang.String> postRSS) |
void |
setPosts(int posts) |
void |
setPostsProcessed(int postsProcessed) |
void |
setProcessAllNewsFeed(boolean processAllNewsFeed) |
void |
setProcessAllPosts(boolean processAllPosts) |
void |
setProcessNewsFeed(boolean processNewsFeed) |
void |
setProcessPost(boolean processPost) |
void |
setProfileName(java.lang.String profileName) |
void |
setReplyToMessages(boolean replyToMessages) |
void |
setRssKeywords(java.util.List<java.lang.String> rssKeywords) |
void |
setStripButtonText(boolean stripButtonText) |
void |
setToken(java.lang.String token) |
void |
setTrackMessageObjects(boolean trackMessageObjects) |
void |
setUserName(java.lang.String userName) |
void |
setWelcomeMessage(java.lang.String welcomeMessage) |
void |
subscribeToMessenger() |
void |
updateThreadSettings(java.lang.String persistentMenu,
java.lang.String getStartedButton,
java.lang.String greetingText)
Set the "Persistent Menu" in the page's Facebook Messenger.
|
addListener, checkEngaged, checkSentence, discover, discoverSentence, getAction, getBot, getEmotionalState, getLanguageState, getListeners, getName, getPrimitive, getResponseListener, getShortTermMemory, initialize, input, isEnabled, log, log, log, notifyExceptionListeners, notifyResponseListener, pool, printInput, removeListener, saveProperties, setAction, setBot, setEmotionalState, setIsEnabled, setLanguageState, setName, setResponseListener, shutdown, toString
public static int MAX_LOOKUP
public static java.lang.String oauthKey
public static java.lang.String oauthSecret
public java.lang.String appOauthKey
public java.lang.String appOauthSecret
public boolean getTrackMessageObjects()
public void setTrackMessageObjects(boolean trackMessageObjects)
public java.lang.String getAppOauthKey()
public void setAppOauthKey(java.lang.String appOauthKey)
public java.lang.String getAppOauthSecret()
public void setAppOauthSecret(java.lang.String appOauthSecret)
public java.util.List<java.lang.String> getPages()
public void setPages(java.util.List<java.lang.String> pages)
public boolean getStripButtonText()
public void setStripButtonText(boolean stripButtonText)
public java.lang.String getButtonType()
public void setButtonType(java.lang.String buttonType)
public java.lang.String getGetStartedButton()
public void setGetStartedButton(java.lang.String getStartedButton)
public java.lang.String getGreetingText()
public void setGreetingText(java.lang.String greetingText)
public java.lang.String getPersistentMenu()
public void setPersistentMenu(java.lang.String persistentMenu)
public int getPosts()
public void setPosts(int posts)
public int getPostsProcessed()
public void setPostsProcessed(int postsProcessed)
public int getMessagesProcessed()
public void setMessagesProcessed(int messagesProcessed)
public int getLikes()
public void setLikes(int likes)
public java.lang.String getPage()
public java.lang.String getPageId()
public void setPageId(java.lang.String pageId)
public java.lang.String getProfileName()
public void setProfileName(java.lang.String profileName)
public void setPage(java.lang.String page)
public java.lang.String getFacebookMessengerAccessToken()
public void setFacebookMessengerAccessToken(java.lang.String facebookMessengerAccessToken)
public java.lang.String getWelcomeMessage()
public void setWelcomeMessage(java.lang.String welcomeMessage)
public boolean getProcessAllPosts()
public void setProcessAllPosts(boolean processAllPosts)
public boolean getProcessAllNewsFeed()
public void setProcessAllNewsFeed(boolean processAllNewsFeed)
public boolean getLikeAllPosts()
public void setLikeAllPosts(boolean likesAllPosts)
public java.util.List<java.lang.String> getRssKeywords()
public void setRssKeywords(java.util.List<java.lang.String> rssKeywords)
public boolean getProcessNewsFeed()
public void setProcessNewsFeed(boolean processNewsFeed)
public java.util.List<java.lang.String> getNewsFeedKeywords()
public void setNewsFeedKeywords(java.util.List<java.lang.String> newsFeedKeywords)
public int getMaxFeed()
public void setMaxFeed(int maxFeed)
public boolean getAutoPost()
public void setAutoPost(boolean autoPost)
public int getAutoPostHours()
public void setAutoPostHours(int autoPostHours)
public java.util.List<java.lang.String> getPostKeywords()
public void setPostKeywords(java.util.List<java.lang.String> statusKeywords)
public java.util.List<java.lang.String> getAutoFriendKeywords()
public void setAutoFriendKeywords(java.util.List<java.lang.String> autoFriendKeywords)
public java.lang.String authorizeAccount(java.lang.String callbackURL) throws facebook4j.FacebookException
facebook4j.FacebookException
public void authorizeComplete(java.lang.String pin) throws facebook4j.FacebookException
facebook4j.FacebookException
public void awake()
awake
in interface Sense
awake
in class BasicSense
public void initProperties()
public void migrateProperties()
migrateProperties
in interface Sense
migrateProperties
in class BasicSense
public void saveProperties(java.util.List<java.lang.String> autoPosts)
public void updateThreadSettings(java.lang.String persistentMenu, java.lang.String getStartedButton, java.lang.String greetingText)
public void connect() throws facebook4j.FacebookException
facebook4j.FacebookException
public void connectAccount() throws facebook4j.FacebookException
facebook4j.FacebookException
public void subscribeToMessenger() throws facebook4j.FacebookException
facebook4j.FacebookException
public void checkProfile()
public void checkWall()
public long[] processComment(facebook4j.Comment comment, facebook4j.Comment parent, Network memory, int count, long max, long last)
public void checkNewsFeed()
public void checkRSS()
public void checkAutoPost()
public boolean isPage()
public java.util.List<java.lang.String> getFriends()
public java.util.List<java.lang.String> getTimeline()
public void checkFriends()
public void log(facebook4j.FacebookException exception)
public void post(java.lang.String text, java.lang.String reply)
public java.lang.String format(java.lang.String text)
public void sendMessage(Vertex source, Vertex message, Vertex conversationId)
public void sendMessage(java.lang.String text, java.lang.String replyUser, java.lang.String id)
public void sendFacebookMessengerMessage(java.lang.String text, java.lang.String replyUser, java.lang.String id)
public void sendFacebookMessengerButtonMessage(java.lang.String text, java.lang.String command, java.lang.String replyUser, java.lang.String id)
public void like(facebook4j.Post post)
public void outputPost(java.lang.String post)
public void input(java.lang.Object input, Network network)
input
in interface Sense
input
in class BasicSense
public void input(facebook4j.Comment comment, facebook4j.Comment parent, Network network)
public void output(Vertex output)
output
in interface Sense
output
in class BasicSense
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
public void inputSentence(java.lang.String text, java.lang.String userName, java.lang.String targetUserName, java.lang.String messageId, long time, Network network)
public java.lang.String getOauthKey()
public void setOauthKey(java.lang.String oauthKey)
public java.lang.String getOauthSecret()
public void setOauthSecret(java.lang.String oauthSecret)
public java.lang.String getToken()
public java.util.Date getTokenExpiry()
public void setToken(java.lang.String token)
public facebook4j.Facebook getConnection() throws facebook4j.FacebookException
facebook4j.FacebookException
public void setConnection(facebook4j.Facebook connection)
public boolean getAutoFriend()
public void setAutoFriend(boolean autoFriend)
public int getMaxFriends()
public void setMaxFriends(int maxFriends)
public boolean getProcessPost()
public void setProcessPost(boolean processPost)
public boolean getReplyToMessages()
public boolean getFacebookMessenger()
public void setFacebookMessenger(boolean facebookMessenger)
public void setReplyToMessages(boolean replyToMessages)
public java.util.List<java.lang.String> getLikeKeywords()
public void setLikeKeywords(java.util.List<java.lang.String> likeKeywords)
public java.util.List<java.lang.String> getPostRSS()
public void setPostRSS(java.util.List<java.lang.String> postRSS)
public int getMaxPost()
public void setMaxPost(int maxPost)
public int getMaxLike()
public void setMaxLike(int maxLike)
public java.lang.String createJSONAttachment(java.lang.String command, java.lang.String id, java.lang.String text)
public java.lang.String createJSONQuickReply(java.lang.String command, java.lang.String id, java.lang.String text)