stackbuilders / twitter-feed

DEPRECATED: Haskell library for retrieving and linkifying a Twitter user timeline.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Hackage No Maintenance Intended

⚠️ 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.

DEPRECATED - Twitter Feed

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.

Usage

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:

  1. OAuth token
  2. OAuth Credential
  3. Number of tweets to retrieve
  4. Whether to exclude replies in feed
  5. 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].

Contributing

Contributions are welcome to this library. Fork, modify, make sure the tests pass, and open a PR.

LICENSE

MIT, see the LICENSE file.

Authors

Justin Leitgeb (Twitter: @justinleitgeb, Github: @jsl) and Andrés Torres (Github: AndresRicardoTorres).


Stack Builders
Check out our libraries | Join our team

About

DEPRECATED: Haskell library for retrieving and linkifying a Twitter user timeline.

License:MIT License


Languages

Language:Haskell 100.0%