Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # Daniel Drucker
- from random import random,choice
- import twitter
- # transitions:
- #
- # prefixes_is -> ada_is [ -> "and" ada_is ]* ["at the same time"]
- # prefixes_has -> ada_has [ -> "and" ada_has ]*
- # prefixes_is -> actions [->]
- # "look at you, being" -> ada_is
- def speak():
- ''' produce an ada-mew utterance '''
- say = {}
- say[('is','prefix')] = ["who's",
- "she's",
- "ada mew's",
- "are you",
- ]
- say[('is','suffix')] = ["a kitty",
- "a mew",
- "a girl",
- "a pretty girl",
- "an ada mew",
- "a cat",
- "a muffin mew",
- "a pumpkin mew",
- "on the bed",
- ]
- say[('has','suffix')] = ["a tail",
- "a face",
- "a nose",
- "ears",
- "fur",
- "a belly",
- "whiskers",
- "a chin",
- ]
- say[('has','prefix')] = ["who has",
- "who's got",
- "she has",
- "she's got",
- "ada mew has",
- "ada mew's got",
- ]
- say['action'] = ["looking",
- "sitting",
- "loafing",
- "leeking",
- ]
- catted = False
- ishas = choice(('is','has'))
- startwith = choice(say[(ishas,'prefix')])
- endwith = choice(say[(ishas,'suffix')])
- say[(ishas,'suffix')].remove(endwith)
- while random() < .45:
- catted = True
- nextwith = choice(say[(ishas,'suffix')])
- say[(ishas,'suffix')].remove(nextwith)
- endwith += " and " + nextwith
- if random() < .30 and catted:
- endwith += " at the same time"
- return startwith + " " + endwith
- if __name__ == "__main__":
- adatwit = ""
- while len(adatwit) == 0 or len(adatwit) > 140:
- adatwit = speak()
- api = twitter.Api(username='adamewsakitty',password='n2sxxx')
- status = api.PostUpdate(adatwit)
Add Comment
Please, Sign In to add comment