twitter

'hs-twitter' is a Haskell package providing a binding to the Twitter API -

  http://twitter.com/
  http://apiwiki.twitter.com/REST+API+Documentation

The binding is functionally complete (Christmas 2008), letting you write
applications in Haskell that accesses Twitter streams and update your
own.
 

Downloading

The latest version of the package is available from 'hackage':
 
 

Getting started, "playing"

 
The package provides a little demonstration of how to tweet from within
GHCi, so provided you've managed to build and install the package (see below),
here's how to use it:
 
foo% ghci Web.Twitter
....
*Web.Twitter> setTwitterUser
User name: <YOUR TWITTER NAME>
User password: <YOUR TWITTER PASSWORD>
*Web.Twitter> tweet "Hey, I'm now using the hs-twitter package"
*Web.Twitter> setUpdateInterval
Check updates every X mins: 1
*Web.Twitter> # after one minute (give and take..) stdout will be filled
with the latest updates from your friends. Checks every X mins
*Web.Twitter> addSearchFilter searchFor{searchQuery="haskell"}
Perform tracking/searches every X mins: 1
1
*Web.Twitter> addSearchFilter searchFor{searchOrWords=["portland","seattle"]}
*Web.Twitter> # like with friend updates, will display new tweet stream tracking info
for the above two queries.


The search query is directed by the SearchContext type.

Getting started, programming

For some code samples showing you how to get started using this
API binding, have a look at Web/Twitter.hs at the top.
 

Installing

This package is provided in Cabal form, so only thing you need to
do to get going is:
 
  foo% runghc Setup configure --user  # that option being optional
  foo% runghc Setup build
  foo% runghc Setup install
 
 
(or, if you are versed in its ways, "cabal update ; cabal install twitter")
The package depends on a bunch of other packages though, so you
need to have them built&installed, as well. They are:
 
 
('cabal install' will take care of chasing these down for you, btw..)

 
Subpages (1): SearchContext
Comments