Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit b33d366477501e543c8cd2d5441d4a7a1c5c25b1 @lucaspiller committed Nov 11, 2011
Showing with 85 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +14 −0 Makefile
  3. +68 −0 README.md
  4. BIN rebar
  5. +1 −0 rebar.config
@@ -0,0 +1,2 @@
+ebin
+deps
@@ -0,0 +1,14 @@
+all: compile
+
+deps:
+ ./rebar get-deps
+
+compile: deps
+ ./rebar compile
+
+dev: compile
+ erl -pa deps/*/ebin -pa ebin -s inets start -s reloader start
+
+clean:
+ ./rebar clean
+ rm -Rf .eunit
@@ -0,0 +1,68 @@
+# Twerl
+
+An Erlang client for the Twitter Streaming API.
+
+## Goals
+
+* A lightweight client which can consume the Twitter Streaming API (DONE).
+* A client manager which allows you to change the search queries without losing any data (WIP).
+
+## Usage
+
+You probably want to include it as a depedency in Rebar:
+
+ {deps,
+ [
+ {twerl, ".*", {git, "https://github.com/lucaspiller/twerl.git", "master"}},
+ ]
+ }.
+
+### Manager
+
+WIP
+
+### Client
+
+Generate auth headers:
+
+ Headers = stream_client_util:generate_auth_headers(TwitterUsername, TwitterPassword).
+
+Generate params:
+
+ {ok, Params} = stream_client_util:keywords_to_track(["erlang"]).
+
+Build a callback function:
+
+ Callback = fun(Data) ->
+ Tweet = proplists:get_value(<<"text">>, Data),
+ io:format("Erlang <3: ~s~n", [Tweet])
+ end.
+
+Start streaming:
+
+ stream_client:connect(stream_client_util:filter_url(), Headers, Params, Callback).
+
+## Development
+
+Start an Erlang shell with reloader support:
+
+ make dev
+
+Compile new code:
+
+ make compile
+
+Run eunit tests:
+
+ make eunit
+
+## Contributing
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests. Pull requests without tests will be ignored.
+* Send me a pull request. Bonus points for topic branches.
+
+## License
+
+<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type">Twerl</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/lucaspiller/twerl" property="cc:attributionName" rel="cc:attributionURL">Luca Spiller</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/lucaspiller/twerl" rel="dct:source">github.com</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/lucaspiller/twerl" rel="cc:morePermissions">https://github.com/lucaspiller/twerl</a>.
BIN rebar
Binary file not shown.
@@ -0,0 +1 @@
+{erl_opts, [debug_info]}.

0 comments on commit b33d366

Please sign in to comment.