Generate a haiku bot that posts to twitter and tumblr.
git clone https://github.com/tumblr/pytumblr.git
cd pytumblr
sudo python setup.py install
git clone https://github.com/tweepy/tweepy.git
cd tweepy
sudo python setup.py install
sudo pip install nltk
python
>>> import nltk
>>> nltk.download()
>>> # select "cmudict" and "stopwords"
git clone https://github.com/csvsoundsystem/haikubot.git
cd haikubot && sudo python setup.py install
####haikubot.yml
:
tmbl_blog : <your haikubots tumblr account>
tmbl_consumer_key : xxxxxxxx
tmbl_consumer_secret : xxxxxxxx
tmbl_oauth_token : xxxxxxxx
tmbl_oauth_token_secret : xxxxxxxx
twt_consumer_key : xxxxxxxx
twt_consumer_secret : xxxxxxxx
twt_access_token : xxxxxxxx
twt_access_token_secret : xxxxxxxx
twt_list_slug : members-of-congress # optionally follow a twitter list
twt_list_owner : cspan # optionally follow a twitter list
from haikubot import HaikuBot
hb = HaikuBot(config="haikubot.yml")
hb.go()
import nltk
from haikubot import HaikuBot
hb = HaikuBot(
config="haikubot.yml"
words = nltk.corpus.stopwords.words('english') # a list of arbitrary words, here we're using stopwords from nltk
)
hb.go()
from haikubot import HaikuBot
hb = HaikuBot(
tmbl_blog = <your haikubots tumblr account>,
tmbl_consumer_key = xxxxxxxx,
tmbl_consumer_secret = xxxxxxxx,
tmbl_oauth_token = xxxxxxxx,
tmbl_oauth_token_secret = xxxxxxxx,
twt_consumer_key = xxxxxxxx,
twt_consumer_secret = xxxxxxxx,
twt_access_token = xxxxxxxx,
twt_access_token_secret = xxxxxxxx,
twt_list_slug = members-of-congress # optionally follow a twitter list,
twt_list_owner = cspan # optionally follow a twitter list,
)
hb.go()
import nltk
from haikubot import HaikuBot
hb = HaikuBot(
tmbl_blog = <your haikubots tumblr account>,
tmbl_consumer_key = xxxxxxxx,
tmbl_consumer_secret = xxxxxxxx,
tmbl_oauth_token = xxxxxxxx,
tmbl_oauth_token_secret = xxxxxxxx,
twt_consumer_key = xxxxxxxx,
twt_consumer_secret = xxxxxxxx,
twt_access_token = xxxxxxxx,
twt_access_token_secret = xxxxxxxx,
words = nltk.corpus.stopwords.words('english') # a list of arbitrary words, here we're using stopwords from nltk
)
hb.go()