Giter Club home page Giter Club logo

yarnbot's Introduction

Yarnbot

Yarnbot is a Slack-bot that knows some yarn-working things, and can search Ravelry for patterns, yarn, or user favorites.

Yarnbot understands:

  • <7 character abbreviations
  • Yarn weights
  • Needle/Hook sizes (say 'US 10', '5mm', 'Crochet L', etc)
  • Basic arithmetic expressions
  • weights: List all yarn weights
  • ravelry favorites <Ravelry Username>
  • ravelry favorites <Ravelry Username> tagged <tag>
  • ravelry search <search terms>: Search patterns
  • ravelry yarn <search terms>: Search yarn
  • ravelry yarn similar to <search terms>: Find similar yarn
  • info: Yarnbot info
  • help: Help text

Running

Before anything else will work, you will need to create a bot in Slack. In your team's app management section, create a custom integration and add a bot configuration. The API Token available there is the SLACK_API_KEY referenced below.

Use a script such as the provded example to set the various access keys and run the client. It will try to stay connected to slack until you tell it to go to sleep, which will cause it to disconnect gracefully.

Yarnbot will create a log file named yarnbot.log in the current directory. By default, it logs at the INFO level, but that can be changed by altering the logging setup at the beginning of yarnbot.py.

As it runs, it keeps track of users it has seen, and saves them in known_users.pkl. Please note that is a python pickle file.

Access Tokens

Yarnbot requires a Slack API key, taken from the SLACK_API_KEY environment variable, as well as Ravelry OAuth1 keys, taken from RAV_ACC_KEY and RAV_SEC_KEY.

Screenshots

Some typical yarnbot commands

yarnbot commands

Ravelry search results show short summaries of each pattern. Clicking the pattern will take you to Ravelry to see details.

yarnbot ravelry search

You can also search for yarn...

yarnbot ravelry yarn

...and find similar yarn.

yarnbot ravelry yarn similar to

yarnbot's People

Contributors

nstepp avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

yarnbot's Issues

Docs

  • make license header a comment (confuses module doc)
  • add missing docstrings
  • clean up rsts

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.