-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Rees
committed
Feb 28, 2017
1 parent
aa3873a
commit 8bf1ff8
Showing
4 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
defmodule Zapdos do | ||
alias Lightning.ColorParsing | ||
|
||
@moduledoc """ | ||
Documentation for Zapdos. | ||
""" | ||
|
||
def get_tweets(query) do | ||
ExTwitter.stream_filter(track: query) | ||
|> Stream.map(fn(tweet) -> tweet.text end) | ||
|> Stream.map(&(update_color(&1))) | ||
|> Enum.to_list | ||
end | ||
|
||
defp update_color(text) do | ||
ColorParsing.get_color(text) | ||
|> ColorParsing.parse_rgb_hex | ||
|> Lightning.Control.change_color(150) | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters