Ruby Job SlackBot
Integrates with Job APIs to deliver jobs to people right in Slack.
JobBot is the SlackBot itself and handles the routing/matching/parsing of commands, it uses slack-ruby-bot
An instance of JobController is held by the JobBot class. It holds the jobs, sources and filters content before returning it.
JobGrabber loops through sources and returns an array of Job objects populated with the data found at specified sources. It currently has adapters for Reddit, Workinstartups and HackerNews Jobs.
SrcGrabber grabs jobs from a specified source, it uses the adapter pattern and has 2 adapters:
We have three adapters for Reddit, WorkInStartups and HNJobs, that use Redd, workinstartups-api and hnjobs, respectively.
The Job object has the following fields:
link, all returned as strings.
Job is the abstraction to create a unified API for jobs coming from Reddit and WorkInStartups, there is potential for turning this into a adaptor system for jobs coming from other services, it currently only has 6 fields:
#Setup your own You're going to need to clone the repo, you can then proceed to fill out the ENV variables you need a slack custom integration token, a reddit client and secret.
Locally it's best to keep them in an
.env file (with dotenv these automatically get loaded in). An example
.env file is provided so you can run
cp .env.example .env from the command line to set up your local environment variables.
To deploy on heroku you will need to set the variables either through the panel or with the heroku command line tools.
#Talking to the bot
hello will give you the following message:
jobsgives you a set of jobs
job <id>gives you a more in-depth description of the job
jobs countdoes what is says on the tin
jobs refreshwill refetch all the jobs from the currently active sources
help will print the following:
jobs in:<category>filters by keyword present in the description of jobs (eg.
jobs in mysql)
jobs <date>gets jobs posted since 'date' (eg.
jobs from 01/01/2016or
jobs today) NOTE: you can't have whitespaces so use underscores or hyphens instead
jobs src:<source>will filter to an individual source without removing/adding all the sources
##Modifying the sources
srcshows you where we're getting the jobs from
namein the form
remove src:<name>removes any source that contains
remove source redditwill delete
jobs limit:<number>sets the maximum number of jobs displayed per command
Copyright and License
This project is licensed under the MIT License.