Git Product home page Git Product logo

papago-proxy-slack-app's Introduction

papago-proxy-slack-app

Slack app to translate messages using papago proxy (for free!)

Since everything is free, it is not guaranteed that the Vercel serverless configuration will not hit its limit at some point. Use it with caution; but for now it works great.

Demo

demo.gif

How does everything work for free?

So I wrote papago proxy which is really just a serverless function with Puppeteer grabbing translation from Papago, on Vercel, for free.

Then I wrote this project to make it installable on Slack as an app, also hosted on Vercel for free (I'm still not sure if it is not restricted).

That's the main reason it would:

  • take almost up to 5~10 seconds to actually provide a translation because everything is free, which means it's slow. But it's good for non-immediate purpose conversation where English (or other languages supported by Papago) to Korean translation or vice versa is needed.
  • sometimes not work when the serverless function not warmed up (for example, if you just got to work and just started to send the first message for today). Just try again and it might just work.

DIY

Deploy papago proxy first if you haven't already

  1. Fork/clone this repository
  2. Sign up for vercel
  3. Add the forked/cloned repository to vercel
  4. Give a shot to your-vercel-deployment-link.vercel.app/api/translate?text=hello%20from%20papago%20proxy to see if the deployment is successful.

Deploy papago-proxy-slack-app

  1. Fork/clone this repository

  2. Sign up for vercel

  3. Add the forked/cloned repository to vercel (make src the root project directory)

  4. Create and add a Slack app to your workspace

  5. Add appropriate scopes to the app on https://api.slack.com/apps/your-app-id/oauth:

    scopes

  6. Add event subscription to your app on https://api.slack.com/apps/your-app-id/event-subscriptions. Insert your-vercel-deployment-link-for-papago-proxy-slack-app.vercel.app/api/event-subscription for the Request URL Input. It should soon become verified. Subscribe to message.channels event too for both bot and user events:

    event subscription

  7. Add your app to any channels.

  8. Add SLACK_USER_OAUTH_TOKEN from to your deployment of Vercel, from https://api.slack.com/apps/your-app-id/oauth.

    Add TRANSLATE_API_URL as your-vercel-deployment-link-for-papago-proxy.vercel.app/api/translate (the deployment created for papago proxy)

    LOGFLARE_* is for logging on Logflare.

    Sign up and insert LOGFLARE_API_KEY and LOGFLARE_SOURCE_TOKEN on Vercel as needed if you want logging on Logflare too. This however is optional.

    oauth access token vercel environment variable

  9. Use it on Slack

What if I just wanna use the app that's published already?

This gives a higher chance that translation is sometimes not going to work because potentially lots of people might be using it. I recommend DIY. However, if your will is still to use the app that already exists on Slack, I'm planning to publish the app very soon, but I need to configure Redirect URLs and some stuffs, so I will do them later.

papago-proxy-slack-app's People

Contributors

9oelm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.