Common Lisp Package: CL-TWIT-REPL

README:

CL-TWITTER

Introduction

On 2010-10-24 I cloned cl-twitter's darcs repository of Ian Eslick's common lisp twitter package..

The package in the repo no longer compiled. After getting it to compile I found that it did not work with twitter's oauth protocol which at that point was the only way to get authorized access to twitter.

It turned out that all the pieces were in place to enable the open authorization protocol. After doing a quick review I found that about half of the twitter api was more-or-less covered.

I split the code into three pieces :

  • an api piece, which enables calls to twitter's rest api.
  • a twitter repl client.
  • a database store.

Consult the respective readme's for more information. ## Current status

api status

The rest api is fully covered.

The streams tweets resources have not been implemented.

twitter repl client

The twitter repl client is functional. What's missing are good pretty printer outputs for some twitter resources.

db api See the README for that module.

FUNCTION

Public

OAUTH-AUTHENTICATE-USER (REQUEST-TOKEN)

Called after the user has been redirected to some page on a twitter app's web site with a `oauth_token=<request-token-string>' parameter. Authenticates the user as if by AUTHENTICATE-USER. If REQUEST-TOKEN is a string, we look up the CL-OAUTH:REQUEST-TOKEN in the *REQUEST-TOKEN-CACHE* list. Otherwise, if it is a CL-OAUTH:REQUEST-TOKEN already, we use that to authorize the request token and then obtain an OAuth access token. Once this is obtained, the user has been logged in to Twitter via OAuth.

OAUTH-MAKE-TWITTER-AUTHORIZATION-URI (&KEY (CONSUMER-KEY *CONSUMER-KEY*) (CONSUMER-SECRET *CONSUMER-SECRET*))

Returns a URL where the user should be directed to authorize the application. Once the user has authorized the user, she will be redirected to the web page specified on the https://twitter.com/apps page for the application.

Undocumented

AUTHENTICATED-USER

CL-TWIT-REPL

DONE-TWITTERING

GET-AUTHENTICATED-USER (USER)

REPL-AUTHENTICATE-USER (&KEY (CONSUMER-KEY *CONSUMER-KEY*) (CONSUMER-SECRET *CONSUMER-SECRET*))

Private

Undocumented

ACCESS-FILE

ALIAS-FILE

CAR-HT-VALUE (HT)

DUMP-ALIAS

GET-ACCESS-TOKEN (USER)

INSTALL-NEW-DISPATCHERS

MAKE-CONS-LST (LST ACCUM)

MAKE-KEYWORD (NAME)

MAKE-USER-DATA (ARGS)

MAKER (LST)

PP-SHOW (S O)

READ-ACCESS-INFO

READ-ALIAS

SERIALIZE-ACCESS-TOKEN (TOKEN)

SERIALIZE-CONSUMER-TOKEN (TOKEN)

SERIALIZE-USER-DATA (TOKEN)

SPECP (LST)

TWITTERP (OBJ)

UNPACK (KV)

USER-NAME (TOKEN)

WRITE-ACCESS-INFO (TWITTER-USER)

MACRO

Public

Undocumented

ALIAS (&OPTIONAL X Y)

UNALIAS (&OPTIONAL X)

Private

Undocumented

CONSTRUCT-ALIAS-FUNC (X Y)

TESTIT (X Y)

GENERIC-FUNCTION

Private

Undocumented

WHO (CONDITION)

VARIABLE

Public

*TWITTER-USER*

The authenticated user

Undocumented

*ACCESS-FILE*

Private

*CL-TWIT-REPL-STREAM*

prefferred output stream for the twitter repl client

*CONSUMER-KEY*

The consumer key for cl-twit-repl, as listed on https://twitter.com/apps. Used for OAuth.

*CONSUMER-SECRET*

The consumer secret for cl-twit-repl, as listed on https://twitter.com/apps. Used for OAuth.

*OAUTH-REQUEST-TOKEN-CACHE*

A list of request tokens that have been generated for OAuth authentication by OAUTH-MAKE-TWITTER-AUTHORIZATION-URI. These are stored in between when the user is directed to a login URI and when the user is authenticated. Automatically pruned every once in a while (by calls to OAUTH-AUTHENTICATE-USER).

*OAUTH-REQUEST-TOKEN-CACHE-MAX-LENGTH*

Max number of request tokens that can be cached by CL-Twitter.

*SAVED-PPRINT-DISPATCH-CONS*

saved version of the cons pp

*SAVED-PRINT-PPRINT-DISPATCH*

saved version of the dispatch table

*TWITTER-TYPES*

list of types in the twitter api for which we 're going to use the show method instead of the pp

Undocumented

*ACCESS-TOKEN-SERIALIZER*

*ALIAS-FILE-NAME*

*ALIAS-REGISTRY*

*CONSUMER-TOKEN-SERIALIZER*

*N*

CONDITION

Private

Undocumented

MISSING-USER-CREDENTIALS