/taskerbox

🎩 Java lightweight automation engine

Primary LanguageJavaApache License 2.0Apache-2.0

Taskerbox

Apache License Build Status Maven Central Coverage Status

Java automation engine based on producers (channels) & consumers (actions)

The main goal is to automate useful tasks. You can control running channels using Desktop UI or lightweight web panel.

Channels

  • Files
  • Message Queues
  • Price Finder
  • Social Media
  • Crawlers
  • Job Seeker
  • Server (Socket) Watchers
  • Package Tracking

Actions

  • Desktop Toaster
  • Email Sending
  • SMS Sending (Plivo)
  • Slack messaging

Example

For example, to receive Tweet Messages in your desktop (Toaster Message), polling every minute:

<taskerbox>

  <org.brunocvcunha.taskerbox.impl.twitter.TwitterChannel
    id="TwitterToaster" every="60000" consumerKey="(consumerKey)"
    consumerSecret="(consumerSecret)"
    accessToken="(accessToken)"
    accessTokenSecret="(accessTokenSecret)">

    <org.brunocvcunha.taskerbox.impl.twitter.TwitterToasterAction />

  </org.brunocvcunha.taskerbox.impl.twitter.TwitterChannel>

</taskerbox>

To receive Hacker News (YCombinator) in your Gmail, also popping up a Toaster (polling every two minutes):

<org.brunocvcunha.taskerbox.impl.feed.FeedChannel
  id="YCombinatorFeed" feedUrl="https://news.ycombinator.com/rss" every="120000">

  <org.brunocvcunha.taskerbox.impl.email.EmailAction
    smtpFrom="Taskerbox v0.1 &lt;taskerbox@brunocandido.com&gt;"
    smtpHost="mail.brunocandido.com" smtpPort="587" smtpUser="taskerbox@brunocandido.com"
    smtpPassword="(password)"  enableTLS="true" email="brunocvcunha@gmail.com" />

  <org.brunocvcunha.taskerbox.impl.feed.FeedToasterAction />

</org.brunocvcunha.taskerbox.impl.feed.FeedChannel>

To test if a specific URL returns an expected response, and send a message on Slack if it fails:

<org.brunocvcunha.taskerbox.impl.http.HTTPUptimeChannel
	id="production" url="https://production-url/api/v1/status"
	contains="false" filter="expected-content-in-response" every="300000" numTries="2">

	<org.brunocvcunha.taskerbox.impl.slack.SlackAction
		token="xoxb-xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx" iconEmoji=":see_no_evil:" slackChannel="#production"
		username="production-status" messageOverride="Production Server is down. Please check https://production-url/"/>

</org.brunocvcunha.taskerbox.impl.http.HTTPUptimeChannel>

Usage

Create a XML configuration file with the desired channels and actions.

Example:

<taskerbox>
		
	<org.brunocvcunha.taskerbox.impl.http.HTTPUptimeChannel
		id="production" url="https://production-url/api/v1/status"
		contains="false" filter="expected-content-in-response" every="300000" numTries="2">
	
		<org.brunocvcunha.taskerbox.impl.slack.SlackAction
			token="xoxb-xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx" iconEmoji=":see_no_evil:" slackChannel="#production"
			username="production-status" messageOverride="Production Server is down. Please check https://production-url/"/>
	
	</org.brunocvcunha.taskerbox.impl.http.HTTPUptimeChannel>


</taskerbox>

Create a Yaml file with the server configuration, that points the fileToUse to the file created above.

Example:

server:
  applicationConnectors:
  - type: http 
    port: 8000
  adminConnectors:
  - type: http
    port: 8001

fileToUse: /home/bruno/taskerbox.xml

Download the release JAR, and start using java -jar taskerbox.jar server /path/to/taskerbox.yml.

It will start a HTTP server in the port specified to access: http://localhost:8000/static/index.html, with all the jobs configured in the XML file.

Sample Screenshot

Taskerbox requires at minimum Java 7.