Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into js_agent_can_be_dryrun
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed May 10, 2015
2 parents 8463ca0 + 1a43bd2 commit 9a7ebc0
Show file tree
Hide file tree
Showing 41 changed files with 581 additions and 229 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DATABASE_ADAPTER=mysql2
DATABASE_ENCODING=utf8
DATABASE_RECONNECT=true
DATABASE_NAME=huginn_development
DATABASE_POOL=5
DATABASE_POOL=10
DATABASE_USERNAME=root
DATABASE_PASSWORD=""
#DATABASE_HOST=your-domain-here.com
Expand Down Expand Up @@ -101,6 +101,9 @@ TUMBLR_OAUTH_SECRET=
DROPBOX_OAUTH_KEY=
DROPBOX_OAUTH_SECRET=

WUNDERLIST_OAUTH_KEY=
WUNDERLIST_OAUTH_SECRET=

#############################
# AWS and Mechanical Turk #
#############################
Expand Down
9 changes: 6 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ gem 'net-ftp-list', '~> 3.2.8' # FtpsiteAgent
gem 'wunderground', '~> 1.2.0' # WeatherAgent
gem 'forecast_io', '~> 2.0.0' # WeatherAgent
gem 'rturk', '~> 2.12.1' # HumanTaskAgent
gem 'weibo_2', '~> 0.1' # Weibo Agents
gem 'hipchat', '~> 1.2.0' # HipchatAgent
gem 'xmpp4r', '~> 0.5.6' # JabberAgent
gem 'mqtt' # MQTTAgent
gem 'slack-notifier', '~> 1.0.0' # SlackAgent
gem 'hypdf', '~> 1.0.7' # PDFInfoAgent

# Weibo Agents
gem 'weibo_2', github: 'cantino/weibo_2', branch: 'master'

# GoogleCalendarPublishAgent
gem "google-api-client", require: 'google/api_client'

# Twitter Agents
gem 'twitter', '~> 5.8.0' # Must to be loaded before cantino-twitter-stream.
gem 'twitter-stream', github: 'dsander/twitter-stream', branch: 'huginn'
gem 'twitter', '~> 5.14.0' # Must to be loaded before cantino-twitter-stream.
gem 'twitter-stream', github: 'cantino/twitter-stream', branch: 'huginn'
gem 'omniauth-twitter'

# Tumblr Agents
Expand All @@ -37,6 +39,7 @@ gem 'haversine'
# Optional Services.
gem 'omniauth-37signals' # BasecampAgent
# gem 'omniauth-github'
gem 'omniauth-wunderlist', github: 'wunderlist/omniauth-wunderlist', ref: 'd0910d0396107b9302aa1bc50e74bb140990ccb8'

# Bundler <1.5 does not recognize :x64_mingw as a valid platform name.
# Unfortunately, it can't self-update because it errors when encountering :x64_mingw.
Expand Down
68 changes: 46 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
GIT
remote: git://github.com/dsander/twitter-stream.git
revision: 1713b4fe5b387580364b39716bb5c26d6601c50f
remote: git://github.com/cantino/twitter-stream.git
revision: f7e7edb0bae013bffabf3598e7147773d9fd370f
branch: huginn
specs:
twitter-stream (0.1.15)
eventmachine (~> 1.0.7)
http_parser.rb (~> 0.6.0)
simple_oauth (~> 0.2.0)
simple_oauth (~> 0.3.0)

GIT
remote: git://github.com/cantino/weibo_2.git
revision: 00e57d29d8252126014b038cd738b02e05e4cfc5
branch: master
specs:
weibo_2 (0.1.7)
hashie (~> 2.0.4)
multi_json (~> 1)
oauth2 (~> 0.9.1)
rest-client (~> 1.8)

GIT
remote: git://github.com/wunderlist/omniauth-wunderlist.git
revision: d0910d0396107b9302aa1bc50e74bb140990ccb8
ref: d0910d0396107b9302aa1bc50e74bb140990ccb8
specs:
omniauth-wunderlist (0.0.1)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -47,7 +67,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.7)
addressable (2.3.8)
arel (6.0.0)
autoparse (0.3.3)
addressable (>= 2.3.1)
Expand Down Expand Up @@ -102,6 +122,8 @@ GEM
warden (~> 1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
dotenv (0.11.1)
dotenv-deployment (~> 0.0.2)
dotenv-deployment (0.0.2)
Expand All @@ -122,7 +144,7 @@ GEM
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
equalizer (0.0.9)
equalizer (0.0.11)
erector (0.10.0)
treetop (>= 1.2.3)
erubis (2.7.0)
Expand Down Expand Up @@ -190,8 +212,10 @@ GEM
httmultiparty (0.3.10)
httparty (>= 0.7.3)
multipart-post
http (0.5.1)
http_parser.rb
http (0.6.4)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
http_parser.rb (0.6.0)
httparty (0.13.1)
json (~> 1.8)
Expand All @@ -205,7 +229,7 @@ GEM
json (1.8.2)
jsonpath (0.5.6)
multi_json
jwt (1.3.0)
jwt (1.4.1)
kaminari (0.16.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
Expand All @@ -229,7 +253,7 @@ GEM
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (0.8.2)
mime-types (2.4.3)
mime-types (2.5)
mini_portile (0.6.2)
minitest (5.5.1)
mqtt (0.3.1)
Expand Down Expand Up @@ -281,7 +305,7 @@ GEM
slop (~> 3.4)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.0)
rack (1.6.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.1)
Expand Down Expand Up @@ -321,7 +345,8 @@ GEM
ref (1.0.5)
responders (2.1.0)
railties (>= 4.2.0, < 5)
rest-client (1.7.3)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (2.0.2)
Expand Down Expand Up @@ -378,7 +403,7 @@ GEM
jwt (>= 0.1.5)
multi_json (>= 1.0.0)
simple-rss (1.3.1)
simple_oauth (0.2.0)
simple_oauth (0.3.1)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -426,24 +451,27 @@ GEM
builder (>= 2.1.2)
jwt (>= 0.1.2)
multi_json (>= 1.3.0)
twitter (5.8.0)
twitter (5.14.0)
addressable (~> 2.3)
buftok (~> 0.2.0)
equalizer (~> 0.0.9)
faraday (~> 0.9.0)
http (~> 0.5.0)
http (~> 0.6.0)
http_parser.rb (~> 0.6.0)
json (~> 1.8)
memoizable (~> 0.4.0)
naught (~> 1.0)
simple_oauth (~> 0.2.0)
simple_oauth (~> 0.3.0)
typhoeus (0.6.9)
ethon (>= 0.7.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unicorn (4.8.3)
kgio (~> 2.6)
rack
Expand All @@ -457,11 +485,6 @@ GEM
webmock (1.17.4)
addressable (>= 2.2.7)
crack (>= 0.3.2)
weibo_2 (0.1.7)
hashie (~> 2.0.4)
multi_json (~> 1)
oauth2 (~> 0.9.1)
rest-client (~> 1.7.3)
wunderground (1.2.0)
addressable
httparty (> 0.6.0)
Expand Down Expand Up @@ -521,6 +544,7 @@ DEPENDENCIES
omniauth-dropbox
omniauth-tumblr
omniauth-twitter
omniauth-wunderlist!
pg
protected_attributes (~> 1.0.8)
pry
Expand All @@ -547,7 +571,7 @@ DEPENDENCIES
therubyracer (~> 0.12.2)
tumblr_client
twilio-ruby (~> 3.11.5)
twitter (~> 5.8.0)
twitter (~> 5.14.0)
twitter-stream!
typhoeus (~> 0.6.3)
tzinfo (>= 1.2.0)
Expand All @@ -556,6 +580,6 @@ DEPENDENCIES
unicorn
vcr
webmock (~> 1.17.4)
weibo_2 (~> 0.1)
weibo_2!
wunderground (~> 1.2.0)
xmpp4r (~> 0.5.6)
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ Huginn is a system for building agents that perform automated tasks for you onli

![the origin of the name](doc/imgs/the-name.png)

#### Here are some of the things that you can do with Huginn right now:
#### Here are some of the things that you can do with Huginn:

* Track the weather and get an email when it's going to rain (or snow) tomorrow ("Don't forget your umbrella!")
* List terms that you care about and receive emails when their occurrence on Twitter changes. (For example, want to know when something interesting has happened in the world of Machine Learning? Huginn will watch the term "machine learning" on Twitter and tell you when there is a large spike.)
* List terms that you care about and receive emails when their occurrence on Twitter changes. (For example, want to know when something interesting has happened in the world of Machine Learning? Huginn will watch the term "machine learning" on Twitter and tell you when there is a spike in discussion.)
* Watch for air travel or shopping deals
* Follow your project names on Twitter and get updates when people mention them
* Scrape websites and receive emails when they change
* Connect to Adioso, HipChat, Basecamp, Growl, FTP, IMAP, Jabber, JIRA, MQTT, nextbus, Pushbullet, Pushover, RSS, Bash, Slack, StubHub, translation APIs, Twilio, Twitter, Wunderground, and Weibo, to name a few.
* Compose digest emails about things you care about to be sent at specific times of the day
* Send digest emails with things that you care about at specific times during the day
* Track counts of high frequency events and send an SMS within moments when they spike, such as the term "san francisco emergency"
* Send and receive WebHooks
* Run arbitrary JavaScript Agents on the server
* Run custom JavaScript or CoffeeScript functions
* Track your location over time
* Create Amazon Mechanical Turk workflows as the inputs, or outputs, of agents (the Amazon Turk Agent is called the "HumanTaskAgent"). For example: "Once a day, ask 5 people for a funny cat photo; send the results to 5 more people to be rated; send the top-rated photo to 5 people for a funny caption; send to 5 final people to rate for funniest caption; finally, post the best captioned photo on my blog."

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cantino/huginn?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Follow [@tectonic](https://twitter.com/tectonic) for updates as Huginn evolves, and join us in our [Gitter room](https://gitter.im/cantino/huginn) to discuss the project.
Join us in our [Gitter room](https://gitter.im/cantino/huginn) to discuss the project and follow [@tectonic](https://twitter.com/tectonic) for updates as Huginn evolves.

### We need your help!
### Join us!

Want to help with Huginn? All contributions are encouraged! You could make UI improvements, [add new Agents](https://github.com/cantino/huginn/wiki/Creating-a-new-agent), write documentation and tutorials, or try tackling [issues tagged with #help-wanted](https://github.com/cantino/huginn/issues?direction=desc&labels=help-wanted&page=1&sort=created&state=open).
Want to help with Huginn? All contributions are encouraged! You could make UI improvements, [add new Agents](https://github.com/cantino/huginn/wiki/Creating-a-new-agent), write [documentation and tutorials](https://github.com/cantino/huginn/wiki), or try tackling [issues tagged with #help-wanted](https://github.com/cantino/huginn/issues?direction=desc&labels=help-wanted&page=1&sort=created&state=open). Please fork, add specs, and send pull requests!

Really want an issue fixed/feature implemented? Or maybe you just want to solve some community issues and earn some extra coffee money? Then you should take a look at the [current bounties on Bountysource](https://www.bountysource.com/trackers/282580-huginn).
Really want a fix or feature? Want to solve some community issues and earn some extra coffee money? Take a look at the [current bounties on Bountysource](https://www.bountysource.com/trackers/282580-huginn).

Have an awesome an idea but not feeling quite up to contributing yet? Head over to our [Official 'suggest an agent' thread ](https://github.com/cantino/huginn/issues/353) and tell us about your cool idea!
Have an awesome idea but not feeling quite up to contributing yet? Head over to our [Official 'suggest an agent' thread ](https://github.com/cantino/huginn/issues/353) and tell us!

## Examples

Expand Down Expand Up @@ -102,15 +102,5 @@ We assume your deployment will run over SSL. This is a very good idea! However,

Huginn is provided under the MIT License.

## Community
Huginn has its own IRC channel on freenode: #huginn.
Some of us are hanging out there, come and say hello.

## Contribution

Huginn is a work in progress and is just getting started. Please get involved! You can [add new Agents](https://github.com/cantino/huginn/wiki/Creating-a-new-agent), expand the [Wiki](https://github.com/cantino/huginn/wiki), or help us simplify and strengthen the Agent API or core application.

Please fork, add specs, and send pull requests!

[![Build Status](https://travis-ci.org/cantino/huginn.png)](https://travis-ci.org/cantino/huginn) [![Coverage Status](https://coveralls.io/repos/cantino/huginn/badge.png)](https://coveralls.io/r/cantino/huginn) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/cantino/huginn/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![Dependency Status](https://gemnasium.com/cantino/huginn.svg)](https://gemnasium.com/cantino/huginn) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282580)](https://www.bountysource.com/trackers/282580-huginn?utm_source=282580&utm_medium=shield&utm_campaign=TRACKER_BADGE)

3 changes: 2 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"website": "https://github.com/cantino/huginn",
"repository": "https://github.com/cantino/huginn",
"env": {
"BUILDPACK_URL": "https://github.com/ddollar/heroku-buildpack-multi.git",
"BUILDPACK_URL": "https://github.com/heroku/heroku-buildpack-multi.git",
"APP_SECRET_TOKEN": {
"generator": "secret"
},
Expand All @@ -19,5 +19,6 @@
"scripts": {
"postdeploy": "bundle exec rake db:migrate"
},
"addons": ["heroku-postgresql"],
"success_url": "/users/sign_up"
}
8 changes: 8 additions & 0 deletions app/assets/javascripts/pages/agent-edit-page.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ class @AgentEditPage
@showCorrectRegionsOnStartup()
$("form.agent-form").on "submit", => @updateFromEditors()

$("#agent_name").each ->
# Select the number suffix if this is a cloned agent.
if matches = this.value.match(/ \(\d+\)$/)
this.focus()
if this.selectionStart?
this.selectionStart = matches.index
this.selectionEnd = this.value.length

# The type selector is only available on the new agent form.
if $("#agent_type").length
$("#agent_type").on "change", => @handleTypeChange(false)
Expand Down
15 changes: 15 additions & 0 deletions app/assets/javascripts/pages/agent-show-page.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class @AgentShowPage
constructor: ->
$(".agent-show #show-tabs a[href='#logs'], #logs .refresh").on "click", @fetchLogs
$(".agent-show #logs .clear").on "click", @clearLogs
$(".agent-show #memory .clear").on "click", @clearMemory

# Trigger tabs when navigated to.
if tab = window.location.href.match(/tab=(\w+)\b/i)?[1]
Expand Down Expand Up @@ -39,6 +40,20 @@ class @AgentShowPage
$("#logs .spinner").stop(true, true).fadeOut ->
$("#logs .refresh, #logs .clear").show()

clearMemory: (e) ->
if confirm("Are you sure you want to clear memory of this Agent?")
agentId = $(e.target).closest("[data-agent-id]").data("agent-id")
e.preventDefault()
$("#memory .spinner").css(display: 'inline-block')
$("#memory .clear").hide()
$.post "/agents/#{agentId}/memory", { "_method": "DELETE" }
.done ->
$("#memory .spinner").fadeOut ->
$("#memory + .memory").text "{\n}\n"
.fail ->
$("#memory .spinner").fadeOut ->
$("#memory .clear").css(display: 'inline-block')

$ ->
Utils.registerPage(AgentShowPage, forPathsMatching: /^agents\/\d+/)

13 changes: 10 additions & 3 deletions app/assets/stylesheets/application.css.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ img.odin {
display: none;
}

img.spinner {
.spinner {
display: none;
vertical-align: bottom;
}
Expand Down Expand Up @@ -172,6 +172,13 @@ span.not-applicable:after {
font-weight: bold;
}

// Memory

#memory .action-icon {
display: inline-block;
cursor: pointer;
}

// Credentials and Ace Editor

#ace-credential-value {
Expand Down Expand Up @@ -251,8 +258,8 @@ h2 .scenario, a span.label.scenario {
width: 200px;
}

$services: twitter 37signals github tumblr dropbox;
$service-colors: #55acee #8fc857 #444444 #2c4762 #007EE5;
$services: twitter 37signals github tumblr dropbox wunderlist;
$service-colors: #55acee #8fc857 #444444 #2c4762 #007EE5 #ED5F27;

@mixin services {
@each $service in $services {
Expand Down
Loading

0 comments on commit 9a7ebc0

Please sign in to comment.