Giter Club home page Giter Club logo

spacebot's People

Contributors

dependabot[bot] avatar mikelax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

iamfozzy imdone

spacebot's Issues

Rovers - Add validation to match rover name <-> camera name

Add a check to make sure that the given rover name and camera name combination is valid.
If not then a specific error should be returned stating that the rover/camera combination is invalid.

example:
rovers photos curiosity pancam - should return camera not available error

Filter out small (thumbnail) images from rovers photos response

It appears that some of the photos responses contain images that are basically thumbnails, ie. 63px square.

The function should filter these images out of the response and not include in the API response to slack.

example: /spacebot-dev rovers photos opportunity all 2016-09-17
This image should be removed.

Rovers - Assume default rover if first param is camera name

As a user, if I forget to type the rover name and start the first parameter with a valid camera name, then it should assume I want to use the default rover.

valid examples:
rovers photos opportunity navcam - existing valid use case
rovers photos navcam - should default to curiosity
rovers photos pancam - should default to opportunity. camera not available on curiosity

invalid example:
rovers photos foo - should return an error

Current error stack trace:

Logging Error: [TypeError: Cannot read property 'name' of undefined] TypeError: Cannot read property 'name' of undefined
at rover (/var/task/lib/rovers.js:102:14)
at /var/task/lib/rovers.js:332:19
at tryCatcher (/var/task/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/var/task/node_modules/bluebird/js/release/method.js:39:29)

Add slack interactive buttons under photos

As a user, I want to be able to "vote", or indicate that a photo is interesting or not by voting with a message button.

Under each image, two buttons should be displayed: Save to Favorites, Interesting.
Saving to Favorites will store the selected image and associated attribute information. The user would then be able to list and retrieve their favorites in separate commands.
The Interesting button would cast a "vote" for the given image that it is interesting, special, or otherwise stands out among all other images. This would be used later on by an algorithm to select interesting and top images that could be surfaced.

The vote results should be recorded in a dynamodb table.
Attributes to store:
Team, user, timestamp
photo ID, Sol, earth_date, Camera, Rover, img_src
text and command (from slash command payload)

APOD - more error checking for valid dates

reproduction command:

/spacebot apod 1812-06-13

As a user, I should receive a friendly error message instead of JSON response for a valid date format but invalid date value for APOD.

This could be enhanced to add a "valid" date check that all services could implement.

Upgrade serverless to version >= 1.6

Currently using sls version 0.5, need to get upgraded to the current serverless version.
This will be a big refactor to the folder structure, sls config files, and more.

Just need to research folder structure for multiple functions sharing lib code.

Add Favorites support to rovers photos

In #3 initial support was added for interactive messages and the Favorite feature to apod.
As a user, I want to be able to favorite a rovers photos photo as well.

It should store similar attributes as for apod but with a couple of additional ones specific to rovers:

Attributes to store:
slack user id, Team, user, channel, timestamp, photo ID
Rovers specific - Sol, earth_date, Camera, Rover, img_src
We may just store all the rovers specific attributes in a single json object.

Handle 400 response from /rovers/name/photos API when no pictures returned

As a user, I don't want to see an error response in slack when I send a slash command that results in no photos found for the given options.

example: /spacebot rovers photos opportunity mast 4332
There were no photos taken from the MAST camera for that given day and rover. Instead of returning an error response in slack, we should inform the user that no photos were found and they should adjust the parameters. It should also print the given command or parameters used.

In a future version it could try to suggest valid options to use.

Add new command - mars weather

As a user, I would like to be able to know the current weather on Mars.
The slash command params would be: /spacebot mars weather

A nice to have feature would be to have the weather report calculated automatically each day by a scheduled lambda function. The output of this function would be a "weather report" image that could then be served in response to above command.

We could look at the past data for ~1484 Sols and calculate some stats like high/low, etc so image could show current values on scale instead of just displaying raw numbers without any real context.

Sources:
https://cab.inta-csic.es/rems/
https://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php
http://cab.inta-csic.es/rems/rems_weather.xml
https://weather.com/science/news/check-weather-mars-where-nasas-maven-headed-20131119

Implement basic supervised training for v1 nl bot interaction

Implement a basic NaturalNode classifier to try and understand commands.

Create a sample training set of documents to determine the command to run:

  • help
  • apod
  • rovers photos
  • rovers info
  • rovers cameras
  • list favorites (future)

There should be a default response if no action could be gleamed from the input.
(Future) create full conversation to allow follow up actions. ie. After performing apod, handle "Add to my favorites list".

This should be made modular to allow for switching up the library implementation. Another option would be to use wit.ai Intent Parser.

APOD - always return image if random parameter is supplied

As a user, if I supply the random parameter to the apod command, I expect a valid response to be returned. We need to handle the use case where the user requests random and it just so happens that an invalid date is selected.

In this case the command should be run again with a new random date until a valid response is returned.

example:
apod random - generates date of: 1997-09-06
NASA API returns 500 for given date. https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=1997-09-06

Catch and Handle 500 error from NASA API

As a user, I don't want to see an internal error message when running an apod command, but rather a friendly message of what happened.

example command: /spacebot apod 2009-10-17
This API is returning a 500 error from NASA, this should be caught and return a message to the user that there is a problem returning the image for this specific date, please try a different date.

We should catch errors from NASA for all APIs, not just apod.

Add support to handle slack ssl_check API calls

It appears that slack will from time to time send "ssl pings" to check and make sure that a given API URL is properly serving SSL requests.

The handlers should consider these a no-op, but must return an HTTP 200 response. It appears the contents of the body does not matter.

Support should be added as a lib function to the following functions:

  • /slack/messages
  • /slack/slash
  • /slack/oauth

Example of the event received in lambda function.

{ body: 'ssl_check=1', pathParams: '{}', queryParams: '{}' }

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.