Giter Site home page Giter Site logo

slacknpodio's Introduction

SlackNPodio

Allows team members to interact with data from Podio by using commands within a Slack channel.
Any team member can easily retrieve information, or make updates without ever opening a browser.
Even team members without a Podio account now have the ability to interact with Podio right from within a Slack channel.

Status:

Gitter Code Climate Issue Count dependencies Status devDependencies Status bitHound Overall Score bitHound Code bitHound Dependencies bitHound Dev Dependencies

SETUP:

  1. Download and run npm install
  2. Rename sample.env to .env
  3. Fill out the .env file with the right credentials.
  4. Run with npm start

App Structure:

SlackNPodio/
├── bot                 //Bot App directory
│   ├── bot.js          //Handles logic related to the bot
│   ├── cmds            //Yargs commands directory
│   │   ├── files.js    //Command to get list of files
│   │   ├── get.js      //Command to get field data
│   │   ├── set.js      //Command to set field data
│   │   └── url.js      //Command to get item link
│   ├── helper.js       //Helper functions to deal with data
│   ├── podio.js        //Handles Podio api requests
│   └── slack.js        //Handles Slack events
├── LICENSE
├── package.json
├── Procfile            //Run command for Heroku
├── README.md
├── sample.env          //API keys and secrets
└── test                //Test are run here
    ├── files.js        //Sample response object for files
    ├── item.js         //Sample response object for items
    └── test-bot.js     //Test for the app

bot.js:

All functions and code related to the bot goes here. This includes but is not limited to logic that specifues which functions to run based on the user input.

helper.js:

Functions that do not directly deal with any api requests go here. This includes but is not limited to pure functions, and functions that deal with objects.

podio.js:

Any functions or code directly related to the podio api goes here.

slack.js:

Functions that deal directly with the slack api goes here. Normally functions to handle events, like when a message arrives and to send data to the slack chat.

test-bot.js:

All test for the app go here.

Contributing:

If you want to contribute to the project, you have to keep in mind certain guidelines.

  1. We use as much functional programming as possible. Try to use pure functions whenever possible. This means the functions do one thing and one thing only. However, in some cases that will not be the case, you might have to call another function to get a value inside another and so on.
  2. Functions that require interaction with the Podio API must go on the bot/bot.js file.
  3. Functions that require interaction with the slack api must go on the bot/slack.js file.
  4. Functions that do not interact with podio or slack directly, but rather an object or other data is a "helper function" and must go on bot/helper.js.
  5. For every function you create, please also create a suitable test for it at test/test-bot.js. We also provide sample Podio API responses in case you need to work with it.
  6. Please provide proper documentation for the function.
/**
* Retrieves the ID for a field value.
* @param {Array} options
* @param {String} name
* @return {Number}
**/
const getFieldValueID = exports.getFieldValueID = (options, value) => {
return filterFields(options, value).id;
}
  1. Please notice that for the functions created, they have a specific declaration that allows to be used in other files via module.exports. This is very important and what allows us to use the helper functions inside and outside of the file, along with testing them.
const getFieldValueID = exports.getFieldValueID = (options, value) => filterFields(options, value).id;
  1. Always run npm run lint to lint and make sure there are not things to fix.

  2. Always run npm run test and make sure all test pass before submining a pull request. 9.

  3. Last but not least, we use ES6 and beyond. So please respect that.

If you have any questions please open an issue. You can also reach me at Gitter.

.env file:

The following is what is needed in the .env file to have things working out properly.

Make sure there is no space in between the =.

botToken='key'
clientId='key'
clientSecret='key'
appToken='key'
appID='key'

Contact:

Github | FreeCodeCamp | CodePen | LinkedIn | Portfolio | E-Mail

If you like the project, please start it to receive updates and help make it more noticeable.

If you would like to help out with financial support, you are welcome to do so via paypal.

I'm currently looking to get my career started so any amount helps. If you would like to hire me for a position or work on a project then you may also contact me about that.

slacknpodio's People

Contributors

rafase282 avatar flyblackbox avatar lilleyse avatar sarjuhansaliya avatar

Stargazers

Shawn Charles avatar  avatar  avatar Davin Green avatar Kyle Ladd avatar Bian Pratama avatar Sergio Cabral avatar Alex Bennett avatar  avatar

Watchers

 avatar James Cloos avatar  avatar Brooke avatar Stevie Huh avatar Sergio Cabral avatar Bian Pratama avatar Le Van Nguyen avatar

slacknpodio's Issues

Implement get file link functionality

@podio Item-Name files

This command should return a list of links for all the files.

It could be done with Get files by app which would return all the files for all those items.

Get files gets all the files and allows some minor filtering.

Get file by id

Seems like there is no way to specifies files by spacific item.

Check if the get item allows any reference to the files and then we can retrieve them separately.
Another option would be to specify how many files to show and the sorting once we can implement arguments from string.

Improve Tests

The test are mostly basic, they don't check for values but for response type mostly.

We want to be as thoroughly with them as possible.

We use Expect for testing.

Better input

Implement input as arguments via string.

string-argv string-argv parses a string into an argument array to mimic process.argv. This is useful when testing Command Line Utilities that you want to pass arguments to and is the opposite of what the other argv utilities do.

Once that part is handled, command-line-args for enforcing the commands.

To generate the help message we can use command-line-usage.

This seems to handle everything and more in one place. It is called yargs.

Add configuration mechanism

We want to be able to configure the bot so we can enable and disable functionality.

We want the set command disabled by default.

Complete README file

The README file needs to be updated to be descriptive of the project. The what, why, who and how of it.

Add security and blame for set command

There are concern issues with the set command.

We want to be able to identify the user making the change request. This means that the history will show the user made that change and not podiobot.

We would need to add user authentication for that.

Retrieve views

Check this

Implement a way to get a list of the views with name and view id.
Then also add another one to get a specific view.

Autopost

Post all item updates to Podio channel
Post all items with 'Live' Status value once per day
Post any item which Status changes to 'Live'

Slack DM for mentions

i don't know how feasible this would be, but a DM when somebody mentions you on podio would be nice.

Use-Case: Another team i work with uses podio to manage their stuff, but we do not use it internally. So i don't always notice when i get mentioned, wich is not ideal. I have emails enabled, but i get a lot of noise there, so suboptimal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.