File: README.md

package info (click to toggle)
haskell-twitter-conduit 0.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 316 kB
  • ctags: 4
  • sloc: haskell: 2,247; makefile: 6
file content (88 lines) | stat: -rw-r--r-- 2,477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# twitter-conduit: An Conduit based Twitter API library for Haskell #

[![Travis](https://img.shields.io/travis/himura/twitter-conduit/master.svg)](https://travis-ci.org/himura/twitter-conduit)
[![Hackage-Deps](https://img.shields.io/hackage-deps/v/twitter-conduit.svg)](http://packdeps.haskellers.com/feed?needle=twitter-conduit)

## About ##

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

Documentation is available in [hackage](http://hackage.haskell.org/package/twitter-conduit).

## Usage ##

    $ cabal update
    $ cabal install twitter-conduit

## Quick Start ##

For a runnable example, see [sample/simple.hs](https://github.com/himura/twitter-conduit/blob/master/sample/simple.hs).
You can find other various examples in [sample](https://github.com/himura/twitter-conduit/tree/master/sample/) directory.

## Run Samples ##

### Build ###

If you would like to use cabal sandbox, prepare sandbox as below:

~~~~
$ cabal sandbox init
~~~~

and then,

~~~~
$ cabal install --only-dependencies -fbuild-samples
$ cabal configure -fbuild-samples
$ cabal build
~~~~

### Run ###

First, you must obtain consumer key and secret from [Twitter Application Management](https://apps.twitter.com/) 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_ACCESSS_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.