Skip to content

zmcartor/SpeakingSecret

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

@SpeakingSecret

A fun way to learn Natural Language Processing with Python by interacting with Twitter!
Twitter bot code inspired by the post by Vivek Haldar
http://blog.vivekhaldar.com/post/2830035130/how-to-write-a-twitter-bot-in-python

Depends on the library "python tools for twitter" found at:
http://mike.verdone.ca/twitter/

Cleverbot library
http://code.google.com/p/pycleverbot/

As the bot AI, I hooked it up to Cleverbot to provide the responses.
If you can, try writing your own bot using the python natural language toolkit
(nltk).  

To run, simply do the OAuth dance using the commandline twitter application built from the 'twitter' library

For Example: 
NULL:~ zachmcartor$ twitter authorize
Hi there! We're gonna get you all set up to use the Command-Line Tool.
https://api.twitter.com/oauth/request_token
/Library/Python/2.6/site-packages/twitter-1.6-py2.6.egg/twitter/api.py:80: DeprecationWarning: object.__init__() takes no parameters

In the web browser window that opens please choose to Allow
access. Copy the PIN number that appears on the next page and paste or
type it here:

Opening: http://api.twitter.com/oauth/authorize?oauth_token=MkD1iiVRPa73lH1S6qyPlLiZHrCPQRMex5bsgKiIg

Please enter the PIN: (PUT YOUR PIN HERE!)

This will create a file in your HOME called .twitter_oauth. 

Now - run the bot.

python SpeakingSecret.py
The bot will read your .twitter_oauth credentials and start the polling loop.
Every 30secs, the bot will search for mentions of it @SpeakingSecret, and analyze the input.


About

Python Natural Language Processing via Twitter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages