Retrieve twitter tweets and process them to have your robot do cool stuff via twitter posts.
How to add the Advanced Twitter Recognition robot skill
- Load the most recent release of ARC (Get ARC).
- Press the Project tab from the top menu bar in ARC.
- Press Add Robot Skill from the button ribbon bar in ARC.
- Choose the Social Media category tab.
- Press the Advanced Twitter Recognition icon to add the robot skill to your project.
Don't have a robot yet?
Follow the Getting Started Guide to build a robot and use the Advanced Twitter Recognition robot skill.
How to use the Advanced Twitter Recognition robot skillRetrieve twitter tweets and process them to have your robot do cool stuff via twitter posts. This skill accepts two ControlCommand() for retrieving either the latest mention or latest tweet.
Mention: A latest mention is when another twitter account sends a message via @UserName to your account. This allows anyone who sends a tweet tagging your @username will be retrieved.
Tweet: A tweet is only tweets from your account. This means only tweets from your account will be retrieved.
1. Text Field
Displays the Twitter messages according to the ControlCommand() script you execute.
2. Twitter Variables
3 different variables for your Twitter message. There's a string variable for the whole twitter message ($TwitterMessage), a string for the author of the message, which may be yours if querying Tweets otherwise it will be another author if it is a mention ($TwitterScreenName) and an number to check if there is a new message to process ($TwitterSuccess).
*Note: The settings are found in a unique location: Options -> Twitter.
1. Get Verification Code Button
Opens up twitter.com for you to sign into your twitter account. Once signed in you can connect your twitter account to ARC. Twitter will give you a verification code to enter in the verification code field.
2. Verify Button
Enter the verification code from twitter.
3. Result Field
Displays the status of the twitter account configuration (Successful/Unsuccessful/Not configured).
How to Use Advanced Twitter Recognition
1) Add the Advanced Twitter Recognition skill to your ARC project (Project -> Add Skill -> Social Media -> Advanced Twitter Recognition).
2) If you'd like to view the Twitter variables in real-time add the Variable watcher skill (Project -> Add Skill -> Scripting -> Variable Watcher).
3) Give ARC Twitter access by using the top menu and selecting Options -> Twitter and entering in the required settings. This allows ARC to communicate with Twitter's API.
4) Run a Code sample to interact with your Twitter account.
This Blockly example queries the latest tweet that you have created from your account and speaks out of the PC speaker.
This Blockly example queries the latest mention that someone tagged your username. This also includes if you tagged yourself.
A more advanced Blockly code snippet will continually check the account every 5 seconds for movement commands. The commands supported in this code are forward, left, or right.
If you simply would like to run a script to display the latest tweet or mention you can use:
Code:controlCommand("Advanced Twitter Recognition", "GetLatestTweet")
Code:controlCommand("Advanced Twitter Recognition", "GetLatestMention")
ARC 2019.06.25.00 or later
The source code for this skill is available here: github.com/synthiam/Behavior_Control_Advanced_Twitter_Recognition