twitter-conduit: Twitter API package with conduit interface and Streaming API support.

[ bsd3, conduit, library, web ] [ Propose Tags ] [ Report a vulnerability ]

This package provides bindings to Twitter's APIs (see https://dev.twitter.com/).

This package uses the http-conduit package for accessing the Twitter API (see http://hackage.haskell.org/package/http-conduit). This package also depends on the twitter-types package (see http://hackage.haskell.org/package/twitter-types).

You can find basic examples in the https://github.com/himura/twitter-conduit/tree/master/sample directory.

This package is under development. If you find something that has not been implemented yet, please send a pull request or open an issue on GitHub.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
run-integrated-test

use debug output when running testsuites

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.0.2.1, 0.0.3, 0.0.4, 0.0.5, 0.0.5.1, 0.0.5.2, 0.0.5.3, 0.0.5.4, 0.0.5.5, 0.0.5.6, 0.0.5.7, 0.0.5.8, 0.0.6, 0.0.7, 0.0.8, 0.0.8.1, 0.1.0, 0.1.1, 0.1.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.2.1, 0.2.2.2, 0.2.3, 0.3.0, 0.4.0, 0.5.0, 0.5.1, 0.6.0, 0.6.1 (info)
Change log ChangeLog.md
Dependencies aeson (>=0.7.0.5), attoparsec (>=0.10), authenticate-oauth (>=1.3), base (>=4.12 && <5), bytestring (>=0.10.2), conduit (>=1.3), conduit-extra (>=1.3), containers, data-default (>=0.3), deepseq, exceptions (>=0.5), ghc-prim, http-client (>=0.5.0), http-conduit (>=2.3 && <2.4), http-types, lens (>=4.4), lens-aeson (>=1), resourcet (>=1.0), text (>=0.11), time, transformers (>=0.2.2), twitter-types (>=0.9), twitter-types-lens (>=0.9) [details]
Tested with ghc ==8.8.4, ghc ==8.10.7, ghc ==9.0.1
License BSD-3-Clause
Author HATTORI Hiroki, Hideyuki Tanaka, Takahiro HIMURA
Maintainer Takahiro HIMURA <taka@himura.jp>
Category Web, Conduit
Home page https://github.com/himura/twitter-conduit
Source repo head: git clone git://github.com/himura/twitter-conduit.git
Uploaded by TakahiroHimura at 2021-11-27T17:36:55Z
Distributions Debian:0.5.0, LTSHaskell:0.6.1, NixOS:0.6.1
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 22957 total (145 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-11-27 [all 1 reports]

Readme for twitter-conduit-0.6.1

[back to package description]

twitter-conduit: An Conduit based Twitter API library for Haskell

CI Hackage Hackage-Deps

About

This is an conduit based Twitter API library for Haskell, including Streaming API supports.

Documentation is available in hackage.

Quick Start

For a runnable example, see sample/simple.hs. You can find other various examples in sample directory.

Run Samples

Build

Building with Cabal

$ cabal v2-build all

Building with Stack

To build with Stack, you should create top-level stack.yaml file first. An example of stack.yaml is like below:

resolver: lts-18.12
packages:
- .
- sample
extra-deps:
- twitter-types-0.11.0
- twitter-types-lens-0.11.0

then, run stack.

$ stack build

Run

First, you must obtain consumer key and secret from Twitter Application Management page, and you have to set those values to environment variables as shown below:

$ export OAUTH_CONSUMER_KEY="YOUR APPLICATION CONSUMER KEY"
$ export OAUTH_CONSUMER_SECRET="YOUR APPLICATION CONSUMER SECRET"

Before you run examples, you must prepare OAuth access token and secret. You can obtain access token and secret by using either PIN or web callback.

If you would like to use the PIN method, you run simply as below, and follow instructions:

$ cabal run oauth_pin

On the other hand, If you would like to use the callback method, do as follows:

$ cabal run oauth_callback

and open http://localhost:3000/signIn in your browser.

In both cases, you can obtain OAUTH_ACCESS_TOKEN and OAUTH_ACCESS_SECRET variables, then you should set those values to environment variables as shown below:

$ export OAUTH_ACCESS_TOKEN="YOUR ACCESS TOKEN"
$ export OAUTH_ACCESS_SECRET="YOUR ACCESS SECRET"

Finally, you can access Twitter UserStream as follows:

$ cabal run userstream

Examples

TODO

Authors and Credits

twitter-conduit initially was written by Takahiro Himura. We would like to thank everyone who supported and contributed to the development of this library.