⚠️ Warning: This library has been deprecated and is no longer maintained. It will not receive any further security patches, features, or bug fixes and is preserved here at GitHub for archival purposes. If you want to use it, we suggest forking the repository and auditing the codebase before use. For more information, contact us at info@stackbuilders.com.
This package is used for retrieving a users' timeline via the Twitter timeline API (OAuth). It retrieves the timeline with entities, and links the usernames and links found in the feed.
It is currently used to retrieve the Twitter feed that is displayed on our web site, http://www.stackbuilders.com.
You must pass your OAuth credentials to the client. Create them as follows:
import Web.Authenticate.OAuth
myoauth :: OAuth
myoauth = newOAuth
{ oauthServerName = "api.twitter.com"
, oauthConsumerKey = "your consumer key"
, oauthConsumerSecret = "your consumer secret"
}
mycred :: Credential
mycred = newCredential "your oauth token"
"your oauth token secret"
Next, you can call the timeline
function directly. The arguments to the
timeline function are:
- OAuth token
- OAuth Credential
- Number of tweets to retrieve
- Whether to exclude replies in feed
- Username for which to retrieve tweets
λ: res <- timeline myoauth mycred 3 False "stackbuilders"
λ: res
Right [SimpleTweet {body = "Ven a nuestro evento de Stack U en Quito el 22 de febrero - Ruby y programaci\243n funcional <a target=\"_blank\" href=\"http://t.co/XHCbwvA8TI\">stackbuilders.com/news/ven-al-ev\8230</a>", tweetId = "434472043862433792"},SimpleTweet {body = "<a target=\"_blank\" href=\"//twitter.com/_eightb\">@_eightb</a> <a target=\"_blank\" href=\"//twitter.com/filipebarcos\">@filipebarcos</a> prove that we didn't use ghcjs! :)", tweetId = "431932790423420929"},SimpleTweet {body = "RT <a target=\"_blank\" href=\"//twitter.com/filipebarcos\">@filipebarcos</a>: w00t!! <a target=\"_blank\" href=\"//twitter.com/stackbuilders\">@stackbuilders</a> just launched their new website! <a target=\"_blank\" href=\"http://t.co/JUD5ALkotF\">stackbuilders.com</a> and it's built in haskell!", tweetId = "431929704388775936"}]
Your response will be an IO Either String [SimpleTweet]
.
Contributions are welcome to this library. Fork, modify, make sure the tests pass, and open a PR.
MIT, see the LICENSE file.
Justin Leitgeb (Twitter: @justinleitgeb, Github: @jsl) and Andrés Torres (Github: AndresRicardoTorres).