Tweet With C (TWC) is a C99-compatible library for using the Twitter API. It is designed to allow you, the programmer, to interact with the API at a variety of levels, from raw cURL calls to structured and typechecked functions that marshal the parameters and block until a response is given.
cURL is the sole dependency. To this end, the library implements JSON parsing, SHA-1 hashing, the OAuth request signing algorithm, and has a custom-built code generator that turns 200 lines of template code into 4000 lines of fleshed out functions with appropriate types that correspond to endpoints in the Twitter API.
Is it asynchronous?
The high-level calls are all synchronous, blocking calls at the moment. However, the functions that the library calls within these are all exported, so you could implement your own versions that are asynchronous.
1. Code can wrap this library in a higher level language (many languages have compatibility layers for working with native/C functions).
2. Projects can interact with twitter without using one of the potentially-heavier libraries that exists in their native language, or are written in languages with no existing twitter API library, should be able to use the above to leverage this library.
Essentially, I'm using C because it's the lingua franca
of the modern software world, and no one else as far as I've seen has filled this niche yet.
How are you getting the API schema?
Right now, I'm using a script I wrote
that crawls the web docs and generates a JSON API schema.
This is error prone and requires constant vigilance to make sure Twitter hasn't changed their web layout, so if they're willing to produce their own schema, I would be happy to switch to that.