-
Notifications
You must be signed in to change notification settings - Fork 135
Client Twitter
The current Twitter client uses a polling mechanism as provided by the Python package tweepy, it is envisaged in the future that this will have streaming added to it. This is in the backlog and is likely to make it into a 1.x release
Once you have created a Twitter account and can sucessfully tweet from it, head over to the Twitter Application Management Dashboard at https://developer.twitter.com/en/apps
Click 'Create an app'. If you have not already applied for a Developer Account, you will be prompted to apply for one now, with the following popup
Click Apply
Select the Twitter account you want to associate your developer account with, and then click 'Continue'
Select the account type and the name of you Twitter bot, then again click 'Continue'
Select the type of bot and also answer the additional questions to help with expiditing your application, again click 'Continue'
Read the terms and conditions ( as if ) and click 'Accept' to continue and then 'Submit Application' at the bottom of the screen
Final complete email validation
These keys and secrets come from registering as a developer on Twitter, creating an app and then following the instructions to create Consumer And Access tokens and secrets. Please note that a Bot needs specific permissions, so please make sure that you set the access to 'Read, Write and Access direct messages'
What type of access does your application need?
Read only
Read and Write << default
Read, Write and Access direct messages << needed!
The client is derived from the following Python class
programy.clients.twitter.TwitterBotClient
To run the Facebook client, you can use the shell script in Y-Bot scripts folder
./y-bot-twitter.sh
Or you can use the command line
python3 -m programy.clients.polling.twitter.client --config <PATH TO CONFIG> --cformat yaml --logging <PATH TO LOGGING>
Eithernway nyou should see the following output on your console
Loading Twitter client, please wait. See log output for progres...
No bot root argument set, defaulting to [../../config/xnix]
Found a total of 1 errors in your grammars, check your errors store
Found a total of 6 duplicates in your grammars, check your duplicates store
Twitter Bot connected and running...
The configuration settings can be found in the wiki page Twitter Configuration.
In addition to configuration settings, there are a number of Twitter-specific license keys. These are stored in license.keys in the /config file. However, for security reasons, this file is excluded from Github and you'll need to create your own with the following settings
TWITTER_USERNAME = programybot
TWITTER_CONSUMER_KEY = xxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_CONSUMER_SECRET = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN = xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWITTER_ACCESS_TOKEN_SECRET = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Email: [email protected] | Twitter: @keiffster | Facebook: keith.sterling | LinkedIn: keithsterling | My Blog
- Home
- Background
- Guiding Principles
- Reporting an Issue
- Installation
- You And Your Bot
- Bots
- Clients
- Configuration
- AIML
- Sentence Splitting
- Natural Langauge Processing
- Normalization
- Spelling
- Sentiment Analysis
- Translation
- Security
- Hot Reload
- Logging
- Out of Band
- Multi Language
- RDF Support
- Rich Media
- Asynchronous Events
- Triggers
- External Services
- Dynamic Sets, Maps & Vars
- Extensions
- Pre & Post Processors
- Custom Nodes
- The Brain Tree
- Utilities
- Building It Yourself
- Creating Your Own Bot
- Contributing
- Performance Testing
- FAQ
- History
- Website